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

  1. /* sys/getpid.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <os2emx.h>
  5. #include "syscalls.h"
  6.  
  7. int __getpid (void)
  8. {
  9.   ULONG rc;
  10.   PTIB ptib;
  11.   PPIB ppib;
  12.  
  13.   rc = DosGetInfoBlocks (&ptib, &ppib);
  14.   if (rc != 0)
  15.     return (-1);
  16.   return (ppib->pib_ulpid);
  17. }
  18.