_getppid.c 205 B

123456789101112
  1. #include <lib.h>
  2. #define getppid _getppid
  3. #include <unistd.h>
  4. PUBLIC int getppid()
  5. {
  6. int p;
  7. p = _callm1(MM, GETPID, 0, 0, 0, NIL_PTR, NIL_PTR, NIL_PTR);
  8. if (p < 0) return(p);
  9. return(_M.m2_i1);
  10. }