2 * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
3 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 #include <sys/resource.h>
13 extern __typeof(wait) __libc_wait;
14 /* Wait for a child to die. When one does, put its status in *STAT_LOC
15 * and return its process ID. For errors, return (pid_t) -1. */
16 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
18 #include <sysdep-cancel.h>
20 pid_t attribute_hidden
21 __libc_wait (__WAIT_STATUS_DEFN stat_loc)
24 return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
25 (struct rusage *) NULL);
27 int oldtype = LIBC_CANCEL_ASYNC ();
29 pid_t result = INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
30 (struct rusage *) NULL);
32 LIBC_CANCEL_RESET (oldtype);
37 /* Wait for a child to die. When one does, put its status in *STAT_LOC
38 * and return its process ID. For errors, return (pid_t) -1. */
39 __pid_t __libc_wait (__WAIT_STATUS_DEFN stat_loc)
41 return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
44 weak_alias(__libc_wait,wait)