]> arthur.barton.de Git - ngircd-alex.git/blob - src/portab/waitpid.c
Don't abort startup when setgid/setuid() fails with EINVAL
[ngircd-alex.git] / src / portab / waitpid.c
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  */
4
5 #include "portab.h"
6
7 /**
8  * @file
9  * waitpid() implementation. Public domain.
10  * Written by Steven D. Blackford for the NeXT system.
11  */
12
13 #ifndef HAVE_WAITPID
14
15 #include <string.h>
16 #include <stdlib.h>
17 #include <sys/types.h>
18
19 GLOBAL int
20 waitpid(pid, stat_loc, options)
21 int pid, *stat_loc, options;
22 {
23         for (;;) {
24                 int wpid = wait(stat_loc);
25                 if (wpid == pid || wpid == -1)
26                         return wpid;
27         }
28 }
29
30 #endif