proc.h 883 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* See LICENSE file for copyright and license details. */
  2. struct procstat {
  3. int pid;
  4. char comm[PATH_MAX + 2]; /* + 2 for '(' and ')' */
  5. unsigned char state;
  6. int ppid;
  7. int pgrp;
  8. int sid;
  9. int tty_nr;
  10. int tpgid;
  11. unsigned flags;
  12. unsigned long minflt;
  13. unsigned long cminflt;
  14. unsigned long majflt;
  15. unsigned long cmajflt;
  16. unsigned long utime;
  17. unsigned long stime;
  18. long cutime;
  19. long cstime;
  20. long priority;
  21. long nice;
  22. long num_threads;
  23. long itrealvalue;
  24. unsigned long long starttime;
  25. unsigned long vsize;
  26. long rss;
  27. long rsslim;
  28. };
  29. struct procstatus {
  30. uid_t uid;
  31. uid_t euid;
  32. gid_t gid;
  33. gid_t egid;
  34. };
  35. int parsecmdline(pid_t pid, char *buf, size_t siz);
  36. int parsestat(pid_t pid, struct procstat *ps);
  37. int parsestatus(pid_t pid, struct procstatus *pstatus);
  38. int proceuid(pid_t pid, uid_t *euid);
  39. int procuid(pid_t pid, uid_t *euid);
  40. int pidfile(const char *file);