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. | |
Pete Williamson
2016/02/29 20:53:47
The fact that we are adding a new function to get
bradnelson
2016/03/03 18:04:02
Done.
| |
64 * | |
65 * Args: | |
66 * pipefd: Point to place to store a read [0] and write [1] fd. | |
67 * Returns: | |
68 * Zero on success. | |
69 */ | |
70 int nacl_spawn_pipe(int pipefd[2]); | |
71 | |
72 /* | |
73 * Create a pipe that can communicate cross-process via JS w/ flags. | |
74 * | |
75 * Args: | |
76 * flags: Flags to create the fd's with (for example O_NONBLOCK). | |
77 * pipefd: Point to place to store a read [0] and write [1] fd. | |
78 * Returns: | |
79 * Zero on success. | |
80 * This is needed because currently fusefs doesn't route information | |
81 * about if an fd has been made O_NONBLOCK via fcntl. | |
82 */ | |
83 int nacl_spawn_pipe_flags(int flags, int pipefd[2]); | |
84 | |
85 /* | |
63 * Implement vfork as a macro. | 86 * Implement vfork as a macro. |
64 * | 87 * |
65 * Returns: | 88 * Returns: |
66 * Pid of a child, or zero if in the child. | 89 * Pid of a child, or zero if in the child. |
67 * | 90 * |
68 * Done as a macro in order to allow portable implementation of | 91 * Done as a macro in order to allow portable implementation of |
69 * vfork's behavior, which requires multiple returns from the same | 92 * vfork's behavior, which requires multiple returns from the same |
70 * code location. | 93 * code location. |
71 * A before function is called to setup vfork state, | 94 * A before function is called to setup vfork state, |
72 * followed by setjmp passing its result to an after function. | 95 * 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 | 122 * The newer version of glibc already declared execvpe |
100 */ | 123 */ |
101 #if !defined(__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9) | 124 #if !defined(__GLIBC__) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 9) |
102 int execvpe(const char *file, char *const argv[], char *const envp[]); | 125 int execvpe(const char *file, char *const argv[], char *const envp[]); |
103 #endif | 126 #endif |
104 int execlpe(const char *path, const char *arg, ...); /* char* const envp[] */ | 127 int execlpe(const char *path, const char *arg, ...); /* char* const envp[] */ |
105 | 128 |
106 __END_DECLS | 129 __END_DECLS |
107 | 130 |
108 #endif /* NACL_SPAWN_SPAWN_H_ */ | 131 #endif /* NACL_SPAWN_SPAWN_H_ */ |
OLD | NEW |