summaryrefslogtreecommitdiff
path: root/libiberty/waitpid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty/waitpid.c')
-rw-r--r--libiberty/waitpid.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libiberty/waitpid.c b/libiberty/waitpid.c
new file mode 100644
index 00000000000..23db0b932d2
--- /dev/null
+++ b/libiberty/waitpid.c
@@ -0,0 +1,11 @@
+int
+waitpid (pid, stat_loc, options)
+ int pid, *stat_loc, options;
+{
+ for (;;)
+ {
+ int wpid = wait(stat_loc);
+ if (wpid == pid || wpid == -1)
+ return wpid;
+ }
+}