| Index: src/untrusted/nacl/posix_spawn.c
|
| diff --git a/src/untrusted/nacl/posix_spawn.c b/src/untrusted/nacl/posix_spawn.c
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2e2d45efc467856af73af3f0c49eb0500b20d3b6
|
| --- /dev/null
|
| +++ b/src/untrusted/nacl/posix_spawn.c
|
| @@ -0,0 +1,30 @@
|
| +/*
|
| + * Copyright (c) 2013 The Native Client Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +#include <errno.h>
|
| +#include <spawn.h>
|
| +#include <sys/types.h>
|
| +
|
| +#include "native_client/src/untrusted/nacl/nacl_irt.h"
|
| +
|
| +int posix_spawn(pid_t *pid, const char *path,
|
| + const posix_spawn_file_actions_t *file_actions,
|
| + const posix_spawnattr_t *attrp,
|
| + char *const argv[], char *const envp[]) {
|
| + if (!__libnacl_irt_init_fn(&__libnacl_irt_dev_process.posix_spawn,
|
| + __libnacl_irt_dev_process_init)) {
|
| + return -1;
|
| + }
|
| +
|
| + int error = __libnacl_irt_dev_process.posix_spawn(pid, path, file_actions,
|
| + attrp, argv, envp);
|
| + if (error) {
|
| + errno = error;
|
| + return -1;
|
| + }
|
| +
|
| + return 0;
|
| +}
|
|
|