Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 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 | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include <setjmp.h> | 7 #include <setjmp.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <sys/wait.h> | 9 #include <sys/wait.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 * Synchronously eval JavaScript. | 53 * Synchronously eval JavaScript. |
| 54 * | 54 * |
| 55 * Args: | 55 * Args: |
| 56 * cmd: Null terminated string containing code to eval. | 56 * cmd: Null terminated string containing code to eval. |
| 57 * data: Pointer to a char* to receive eval string result. | 57 * data: Pointer to a char* to receive eval string result. |
| 58 * len: Pointer to a size_t to receive the length of the result. | 58 * len: Pointer to a size_t to receive the length of the result. |
| 59 */ | 59 */ |
| 60 void jseval(const char* cmd, char** data, size_t* len); | 60 void jseval(const char* cmd, char** data, size_t* len); |
| 61 | 61 |
| 62 /* | 62 /* |
| 63 * Create a pipe that can communicate cross-process via JS. | |
| 64 * | |
| 65 * Args: | |
| 66 * pipefd: Point to place to store a read [0] and write [1] fd. | |
| 67 * Returns: | |
| 68 * Zero on success. | |
| 69 * TODO(bradnelson): The should work differently, see both: | |
| 70 * https://bugs.chromium.org/p/webports/issues/detail?id=247 | |
| 71 * https://bugs.chromium.org/p/webports/issues/detail?id=248 | |
| 72 */ | |
| 73 int nacl_spawn_pipe(int pipefd[2]); | |
| 74 | |
| 75 /* | |
| 76 * Create a pipe that can communicate cross-process via JS w/ flags. | |
| 77 * | |
| 78 * Args: | |
| 79 * flags: Flags to create the fd's with (for example O_NONBLOCK). | |
| 80 * pipefd: Point to place to store a read [0] and write [1] fd. | |
| 81 * Returns: | |
| 82 * Zero on success. | |
| 83 * This is needed because currently fusefs doesn't route information | |
| 84 * about if an fd has been made O_NONBLOCK via fcntl. | |
| 85 * TODO(bradnelson): The should work differently, see both: | |
| 86 * https://bugs.chromium.org/p/webports/issues/detail?id=247 | |
| 87 * https://bugs.chromium.org/p/webports/issues/detail?id=248 | |
| 88 */ | |
| 89 int nacl_spawn_pipe_flags(int flags, int pipefd[2]); | |
|
Sam Clegg
2016/03/03 19:20:54
Posix functions normally put flags at the end of t
Sam Clegg
2016/03/03 19:22:10
Also the POSIX version of this is called pipe2() r
bradn
2016/03/03 19:39:34
Wow, didn't know about that one.
Switched to pipe2
bradn
2016/03/03 19:39:34
Indeed.
| |
| 90 | |
| 91 /* | |
| 63 * Implement vfork as a macro. | 92 * Implement vfork as a macro. |
| 64 * | 93 * |
| 65 * Returns: | 94 * Returns: |
| 66 * Pid of a child, or zero if in the child. | 95 * Pid of a child, or zero if in the child. |
| 67 * | 96 * |
| 68 * Done as a macro in order to allow portable implementation of | 97 * Done as a macro in order to allow portable implementation of |
| 69 * vfork's behavior, which requires multiple returns from the same | 98 * vfork's behavior, which requires multiple returns from the same |
| 70 * code location. | 99 * code location. |
| 71 * A before function is called to setup vfork state, | 100 * A before function is called to setup vfork state, |
| 72 * followed by setjmp passing its result to an after function. | 101 * followed by setjmp passing its result to an after function. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 99 * The newer version of glibc already declared execvpe | 128 * The newer version of glibc already declared execvpe |
| 100 */ | 129 */ |
| 101 #if !defined(__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9) | 130 #if !defined(__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9) |
| 102 int execvpe(const char *file, char *const argv[], char *const envp[]); | 131 int execvpe(const char *file, char *const argv[], char *const envp[]); |
| 103 #endif | 132 #endif |
| 104 int execlpe(const char *path, const char *arg, ...); /* char* const envp[] */ | 133 int execlpe(const char *path, const char *arg, ...); /* char* const envp[] */ |
| 105 | 134 |
| 106 __END_DECLS | 135 __END_DECLS |
| 107 | 136 |
| 108 #endif /* NACL_SPAWN_SPAWN_H_ */ | 137 #endif /* NACL_SPAWN_SPAWN_H_ */ |
| OLD | NEW |