procfs.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef _SYS_PROCFS_H
  2. #define _SYS_PROCFS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <sys/time.h>
  7. #include <sys/types.h>
  8. #include <sys/user.h>
  9. typedef unsigned long elf_greg_t;
  10. #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
  11. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  12. #if __WORDSIZE == 32
  13. typedef struct user_fpregs_struct elf_fpregset_t;
  14. typedef struct user_fpxregs_struct elf_fpxregset_t;
  15. #else
  16. typedef struct user_fpregs_struct elf_fpregset_t;
  17. #endif
  18. struct elf_siginfo {
  19. int si_signo;
  20. int si_code;
  21. int si_errno;
  22. };
  23. struct elf_prstatus {
  24. struct elf_siginfo pr_info;
  25. short int pr_cursig;
  26. unsigned long int pr_sigpend;
  27. unsigned long int pr_sighold;
  28. pid_t pr_pid;
  29. pid_t pr_ppid;
  30. pid_t pr_pgrp;
  31. pid_t pr_sid;
  32. struct timeval pr_utime;
  33. struct timeval pr_stime;
  34. struct timeval pr_cutime;
  35. struct timeval pr_cstime;
  36. elf_gregset_t pr_reg;
  37. int pr_fpvalid;
  38. };
  39. #define ELF_PRARGSZ 80
  40. struct elf_prpsinfo
  41. {
  42. char pr_state;
  43. char pr_sname;
  44. char pr_zomb;
  45. char pr_nice;
  46. unsigned long int pr_flag;
  47. #if __WORDSIZE == 32
  48. unsigned short int pr_uid;
  49. unsigned short int pr_gid;
  50. #else
  51. unsigned int pr_uid;
  52. unsigned int pr_gid;
  53. #endif
  54. int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  55. char pr_fname[16];
  56. char pr_psargs[ELF_PRARGSZ];
  57. };
  58. typedef void *psaddr_t;
  59. typedef elf_gregset_t prgregset_t;
  60. typedef elf_fpregset_t prfpregset_t;
  61. typedef elf_fpregset_t fpregset_t;
  62. typedef pid_t lwpid_t;
  63. typedef struct elf_prstatus prstatus_t;
  64. typedef struct elf_prpsinfo prpsinfo_t;
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif