OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 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 <errno.h> |
| 8 #include <spawn.h> |
| 9 #include <sys/types.h> |
| 10 |
| 11 #include "native_client/src/untrusted/nacl/nacl_irt.h" |
| 12 |
| 13 int posix_spawn(pid_t *pid, const char *path, |
| 14 const posix_spawn_file_actions_t *file_actions, |
| 15 const posix_spawnattr_t *attrp, |
| 16 char *const argv[], char *const envp[]) { |
| 17 if (!__libnacl_irt_init_fn(&__libnacl_irt_dev_process.posix_spawn, |
| 18 __libnacl_irt_dev_process_init)) { |
| 19 return -1; |
| 20 } |
| 21 |
| 22 int error = __libnacl_irt_dev_process.posix_spawn(pid, path, file_actions, |
| 23 attrp, argv, envp); |
| 24 if (error) { |
| 25 errno = error; |
| 26 return -1; |
| 27 } |
| 28 |
| 29 return 0; |
| 30 } |
OLD | NEW |