OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #include <sys/types.h> |
| 8 #include <sys/wait.h> |
| 9 #include <errno.h> |
| 10 |
| 11 #include "native_client/src/untrusted/nacl/nacl_irt.h" |
| 12 |
| 13 pid_t waitpid(pid_t pid, int *status, int options) { |
| 14 if (__libnacl_irt_dev_process.waitpid == NULL) { |
| 15 __libnacl_irt_process_init(); |
| 16 if (__libnacl_irt_dev_process.waitpid == NULL) { |
| 17 errno = ENOSYS; |
| 18 return -1; |
| 19 } |
| 20 } |
| 21 |
| 22 int error = __libnacl_irt_dev_process.waitpid(&pid, status, options); |
| 23 if (error) { |
| 24 errno = error; |
| 25 return -1; |
| 26 } |
| 27 |
| 28 return pid; |
| 29 } |
OLD | NEW |