home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / m2posx14 / test / showids.mpp < prev    next >
Encoding:
Text File  |  1994-05-29  |  1.1 KB  |  38 lines

  1. MODULE ShowIDs;
  2. __IMP_SWITCHES__
  3. __DEBUG__
  4. #ifdef HM2
  5. #ifdef __LONG_WHOLE__
  6. (*$!i+: Modul muss mit $i- uebersetzt werden! *)
  7. (*$!w+: Modul muss mit $w- uebersetzt werden! *)
  8. #else
  9. (*$!i-: Modul muss mit $i+ uebersetzt werden! *)
  10. (*$!w-: Modul muss mit $w+ uebersetzt werden! *)
  11. #endif
  12. #endif
  13. (* 29-Mai-94, hk *)
  14.  
  15.  
  16. #if (defined MM2) && (defined __DEBUG_CODE__)
  17. IMPORT Debug;
  18. #endif
  19.  
  20. VAL_INTRINSIC
  21.  
  22. FROM proc  IMPORT getpid, getppid, getpgrp, getuid, geteuid, getgid, getegid;
  23. FROM InOut IMPORT WriteInt, WriteString, WriteLn, Read;
  24.  
  25. VAR ch : CHAR;
  26.  
  27. BEGIN
  28.  WriteString(" parent process id: "); WriteInt(INT(getppid()), 0); WriteLn;
  29.  WriteString("    own process id: "); WriteInt(INT(getpid()), 0); WriteLn;
  30.  WriteString("  process group id: "); WriteInt(INT(getpgrp()), 0); WriteLn;
  31.  WriteString("      real user id: "); WriteInt(INT(getuid()), 0); WriteLn;
  32.  WriteString("     real group id: "); WriteInt(INT(getgid()), 0); WriteLn;
  33.  WriteString(" effective user id: "); WriteInt(INT(geteuid()), 0); WriteLn;
  34.  WriteString("effective group id: "); WriteInt(INT(getegid()), 0); WriteLn;
  35.  
  36.  Read(ch);
  37. END ShowIDs.
  38.