home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / SYS / WAITPID.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  442 b   |  22 lines

  1. /* sys/waitpid.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <os2emx.h>
  5. #include "syscalls.h"
  6.  
  7. int __waitpid (int pid, int *status, int options)
  8. {
  9.   ULONG rc;
  10.   RESULTCODES res;
  11.   PID pid2;
  12.  
  13.   rc = DosWaitChild (DCWA_PROCESS, DCWW_WAIT, &res, &pid2, pid);
  14.   if (rc != 0)
  15.     {
  16.       _sys_set_errno (rc);
  17.       return (-1);
  18.     }
  19.   *status = res.codeResult << 8;
  20.   return (pid);
  21. }
  22.