about summary refs log tree commit diff
path: root/posix/waitpid.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/waitpid.c')
-rw-r--r--posix/waitpid.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/posix/waitpid.c b/posix/waitpid.c
index adae03918a..214c564623 100644
--- a/posix/waitpid.c
+++ b/posix/waitpid.c
@@ -16,8 +16,8 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
+#include <stdlib.h>
 #include <sys/wait.h>
-#include <sys/types.h>
 
 
 /* Wait for a child matching PID to die.
@@ -35,16 +35,7 @@
 pid_t
 __waitpid (pid_t pid, int *stat_loc, int options)
 {
-  if ((options & ~(WNOHANG|WUNTRACED)) != 0)
-    {
-      __set_errno (EINVAL);
-      return (pid_t) -1;
-    }
-
-  __set_errno (ENOSYS);
-  return (pid_t) -1;
+  return __wait4 (pid, stat_loc, options, NULL);
 }
 libc_hidden_def (__waitpid)
 weak_alias (__waitpid, waitpid)
-
-stub_warning (waitpid)