home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / unix.subproj / isfork.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  317 b   |  26 lines

  1. /* isfork.c 
  2.    Retry fork several times before giving up.  */
  3.  
  4. #include "uucp.h"
  5.  
  6. #include "sysdep.h"
  7.  
  8. #include <errno.h>
  9.  
  10. pid_t
  11. ixsfork ()
  12. {
  13.   int i;
  14.   pid_t iret;
  15.  
  16.   for (i = 0; i < 10; i++)
  17.     {
  18.       iret = fork ();
  19.       if (iret >= 0 || errno != EAGAIN)
  20.     return iret;
  21.       sleep (5);
  22.     }
  23.  
  24.   return iret;
  25. }
  26.