aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstddjb/waitn_reap_posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/waitn_reap_posix.c')
-rw-r--r--src/libstddjb/waitn_reap_posix.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/libstddjb/waitn_reap_posix.c b/src/libstddjb/waitn_reap_posix.c
deleted file mode 100644
index 4a6994f..0000000
--- a/src/libstddjb/waitn_reap_posix.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ISC license. */
-
-#include <sys/wait.h>
-
-#include <skalibs/djbunix.h>
-
-int waitn_reap_posix (pid_t *pids, unsigned int len, int *w)
-{
- pid_t wanted = len ? pids[len-1] : 0 ;
- unsigned int n = 0 ;
- while (len)
- {
- int wstat ;
- int r = wait_pids_nohang(pids, len, &wstat) ;
- if (r < 0) return r ;
- else if (!r) break ;
- if (pids[r-1] == wanted) *w = wstat ;
- pids[r-1] = pids[--len] ;
- n++ ;
- }
- return n ;
-}