procfs.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
  2. The GNU C Library is free software; you can redistribute it and/or
  3. modify it under the terms of the GNU Lesser General Public
  4. License as published by the Free Software Foundation; either
  5. version 2.1 of the License, or (at your option) any later version.
  6. The GNU C Library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public
  11. License along with the GNU C Library; if not, see
  12. <http://www.gnu.org/licenses/>. */
  13. #ifndef _SYS_PROCFS_H
  14. #define _SYS_PROCFS_H 1
  15. /* This is somehow modelled after the file of the same name on SysVr4
  16. systems. It provides a definition of the core file format for ELF
  17. used on Linux. */
  18. #include <features.h>
  19. #include <signal.h>
  20. #include <sys/time.h>
  21. #include <sys/types.h>
  22. #include <sys/ucontext.h>
  23. #include <sys/user.h>
  24. #include <bits/wordsize.h>
  25. __BEGIN_DECLS
  26. #define ELF_NGREG 38
  27. typedef struct
  28. {
  29. union
  30. {
  31. unsigned long pr_regs[32];
  32. double pr_dregs[16];
  33. } pr_fr;
  34. unsigned long __unused;
  35. unsigned long pr_fsr;
  36. unsigned char pr_qcnt;
  37. unsigned char pr_q_entrysize;
  38. unsigned char pr_en;
  39. unsigned int pr_q[64];
  40. } elf_fpregset_t;
  41. typedef unsigned long elf_greg_t;
  42. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  43. struct elf_siginfo
  44. {
  45. int si_signo; /* Signal number. */
  46. int si_code; /* Extra code. */
  47. int si_errno; /* Errno. */
  48. };
  49. /* Definitions to generate Intel SVR4-like core files. These mostly
  50. have the same names as the SVR4 types with "elf_" tacked on the
  51. front to prevent clashes with linux definitions, and the typedef
  52. forms have been avoided. This is mostly like the SVR4 structure,
  53. but more Linuxy, with things that Linux does not support and which
  54. gdb doesn't really use excluded. Fields present but not used are
  55. marked with "XXX". */
  56. struct elf_prstatus
  57. {
  58. struct elf_siginfo pr_info; /* Info associated with signal. */
  59. short int pr_cursig; /* Current signal. */
  60. unsigned long int pr_sigpend; /* Set of pending signals. */
  61. unsigned long int pr_sighold; /* Set of held signals. */
  62. __pid_t pr_pid;
  63. __pid_t pr_ppid;
  64. __pid_t pr_pgrp;
  65. __pid_t pr_sid;
  66. struct timeval pr_utime; /* User time. */
  67. struct timeval pr_stime; /* System time. */
  68. struct timeval pr_cutime; /* Cumulative user time. */
  69. struct timeval pr_cstime; /* Cumulative system time. */
  70. elf_gregset_t pr_reg; /* GP registers. */
  71. int pr_fpvalid; /* True if math copro being used. */
  72. };
  73. #define ELF_PRARGSZ (80) /* Number of chars for args */
  74. struct elf_prpsinfo
  75. {
  76. char pr_state; /* Numeric process state. */
  77. char pr_sname; /* Char for pr_state. */
  78. char pr_zomb; /* Zombie. */
  79. char pr_nice; /* Nice val. */
  80. unsigned long int pr_flag; /* Flags. */
  81. unsigned short int pr_uid;
  82. unsigned short int pr_gid;
  83. int pr_pid, pr_ppid, pr_pgrp, pr_sid;
  84. /* Lots missing */
  85. char pr_fname[16]; /* Filename of executable. */
  86. char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
  87. };
  88. /* Addresses. */
  89. typedef void *psaddr_t;
  90. /* Register sets. Linux has different names. */
  91. typedef elf_gregset_t prgregset_t;
  92. typedef elf_fpregset_t prfpregset_t;
  93. /* We don't have any differences between processes and threads,
  94. therefore have only one PID type. */
  95. typedef __pid_t lwpid_t;
  96. typedef struct elf_prstatus prstatus_t;
  97. typedef struct elf_prpsinfo prpsinfo_t;
  98. __END_DECLS
  99. #endif /* sys/procfs.h */