| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 #include <sys/types.h> | |
| 8 #include <sys/wait.h> | |
| 9 | |
| 10 #ifdef __BIONIC__ | |
| 11 // TODO(sbc): remove this once bionic toolchain gets a copy of | |
| 12 // spawn.h. | |
| 13 #include <bsd_spawn.h> | |
| 14 #else | |
| 15 #include_next <spawn.h> | |
| 16 #endif | |
| 17 | |
| 18 /* | |
| 19 * Include guards are here so that this header can forward to the next one in | |
| 20 * presence of an already installed copy of nacl-spawn. | |
| 21 */ | |
| 22 #ifndef _NACL_SPAWN_SPAWN_H_ | |
| 23 #define _NACL_SPAWN_SPAWN_H_ | |
| 24 | |
| 25 #ifdef __cplusplus | |
| 26 extern "C" { | |
| 27 #endif | |
| 28 | |
| 29 /* | |
| 30 * Spawn a child using the given args. | |
| 31 * | |
| 32 * Args: | |
| 33 * mode: Execute mode, one of the defines below. | |
| 34 * path: The program to run. | |
| 35 * argv: The startup arguments for the child. | |
| 36 * Returns: | |
| 37 * Process id of the child or -1 for error. | |
| 38 */ | |
| 39 extern int spawnv(int mode, const char* path, char *const argv[]); | |
| 40 | |
| 41 /* | |
| 42 * Spawn a child using the current environment and given args. | |
| 43 * | |
| 44 * Args: | |
| 45 * mode: Execute mode, one of the defines below. | |
| 46 * path: The program to run. | |
| 47 * argv: The startup arguments for the child. | |
| 48 * envp: The environment to run the child in. | |
| 49 * Returns: | |
| 50 * Process id of the child or -1 for error. | |
| 51 */ | |
| 52 extern int spawnve(int mode, const char* path, | |
| 53 char *const argv[], char *const envp[]); | |
| 54 #define P_WAIT 0 | |
| 55 #define P_NOWAIT 1 | |
| 56 #define P_NOWAITO 1 | |
| 57 #define P_OVERLAY 2 | |
| 58 | |
| 59 #ifdef __cplusplus | |
| 60 } | |
| 61 #endif | |
| 62 | |
| 63 #endif | |
| OLD | NEW |