diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 08:53:40 +0000 |
commit | d6583bb2a13f329cf0332ef2570eb8bb8fc0e39c (patch) | |
tree | ece253b876159b39c620e62b6c9b1174642e070e /gnu/libexec/uucp/libunix/isfork.c |
initial import of NetBSD tree
Diffstat (limited to 'gnu/libexec/uucp/libunix/isfork.c')
-rw-r--r-- | gnu/libexec/uucp/libunix/isfork.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/libexec/uucp/libunix/isfork.c b/gnu/libexec/uucp/libunix/isfork.c new file mode 100644 index 00000000000..f067d07552c --- /dev/null +++ b/gnu/libexec/uucp/libunix/isfork.c @@ -0,0 +1,25 @@ +/* isfork.c + Retry fork several times before giving up. */ + +#include "uucp.h" + +#include "sysdep.h" + +#include <errno.h> + +pid_t +ixsfork () +{ + int i; + pid_t iret; + + for (i = 0; i < 10; i++) + { + iret = fork (); + if (iret >= 0 || errno != EAGAIN) + return iret; + sleep (5); + } + + return iret; +} |