aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstddjb/wait_reap.c
blob: e0de653705dd0f2a81f1241771fbc1c3ec87d418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <errno.h>

#include <skalibs/djbunix.h>

unsigned int wait_reap ()
{
  int e = errno ;
  unsigned int n = 0 ;
  int wstat ;
  while (wait_nohang(&wstat) > 0) n++ ;
  errno = e ;
  return n ;
}