summaryrefslogtreecommitdiff
path: root/src/libstddjb/wait_nointr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/wait_nointr.c')
-rw-r--r--src/libstddjb/wait_nointr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstddjb/wait_nointr.c b/src/libstddjb/wait_nointr.c
new file mode 100644
index 0000000..02dcd42
--- /dev/null
+++ b/src/libstddjb/wait_nointr.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <skalibs/djbunix.h>
+
+pid_t wait_nointr (int *wstat)
+{
+ register pid_t r ;
+ do
+ r = wait(wstat) ;
+ while ((r == (pid_t)-1) && (errno == EINTR)) ;
+ return r ;
+}