summaryrefslogtreecommitdiff
path: root/wait_nohang.c
diff options
context:
space:
mode:
Diffstat (limited to 'wait_nohang.c')
-rw-r--r--wait_nohang.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/wait_nohang.c b/wait_nohang.c
new file mode 100644
index 0000000..bea2774
--- /dev/null
+++ b/wait_nohang.c
@@ -0,0 +1,12 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+#include "haswaitp.h"
+
+int wait_nohang(wstat) int *wstat;
+{
+#ifdef HASWAITPID
+ return waitpid(-1,wstat,WNOHANG);
+#else
+ return wait3(wstat,WNOHANG,(struct rusage *) 0);
+#endif
+}