]>
Commit | Line | Data |
---|---|---|
d4697bc9 | 1 | /* Copyright (C) 1999-2014 Free Software Foundation, Inc. |
d5efd131 MF |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
5 | modify it under the terms of the GNU Lesser General Public | |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
8 | ||
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public | |
75efb018 MF |
15 | License along with the GNU C Library; if not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
d5efd131 MF |
17 | |
18 | #ifndef _SYS_PROCFS_H | |
19 | #define _SYS_PROCFS_H 1 | |
20 | ||
21 | /* This is somehow modelled after the file of the same name on SysVr4 | |
22 | systems. It provides a definition of the core file format for ELF | |
23 | used on Linux. */ | |
24 | ||
25 | #include <features.h> | |
26 | #include <signal.h> | |
27 | #include <sys/time.h> | |
28 | #include <sys/types.h> | |
29 | #include <sys/ucontext.h> | |
30 | #include <sys/user.h> | |
31 | ||
32 | __BEGIN_DECLS | |
33 | ||
34 | struct elf_siginfo | |
35 | { | |
36 | int si_signo; /* Signal number. */ | |
37 | int si_code; /* Extra code. */ | |
38 | int si_errno; /* Errno. */ | |
39 | }; | |
40 | ||
41 | /* We really need just 72 but let's leave some headroom... */ | |
42 | #define ELF_NGREG 128 | |
43 | /* f0 and f1 could be omitted, but so what... */ | |
44 | #define ELF_NFPREG 128 | |
45 | ||
46 | typedef unsigned long elf_greg_t; | |
47 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |
48 | ||
49 | typedef struct ia64_fpreg elf_fpreg_t; | |
50 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |
51 | ||
52 | typedef elf_greg_t greg_t; | |
53 | typedef elf_gregset_t gregset_t; | |
54 | typedef elf_fpregset_t fpregset_t; | |
55 | #define NGREG ELF_NGREG | |
56 | ||
57 | /* Definitions to generate Intel SVR4-like core files. These mostly | |
58 | have the same names as the SVR4 types with "elf_" tacked on the | |
59 | front to prevent clashes with linux definitions, and the typedef | |
60 | forms have been avoided. This is mostly like the SVR4 structure, | |
61 | but more Linuxy, with things that Linux does not support and which | |
62 | gdb doesn't really use excluded. Fields present but not used are | |
63 | marked with "XXX". */ | |
64 | struct elf_prstatus | |
65 | { | |
66 | #if 0 | |
67 | long int pr_flags; /* XXX Process flags. */ | |
68 | short int pr_why; /* XXX Reason for process halt. */ | |
69 | short int pr_what; /* XXX More detailed reason. */ | |
70 | #endif | |
71 | struct elf_siginfo pr_info; /* Info associated with signal. */ | |
72 | short int pr_cursig; /* Current signal. */ | |
73 | unsigned long int pr_sigpend; /* Set of pending signals. */ | |
74 | unsigned long int pr_sighold; /* Set of held signals. */ | |
75 | #if 0 | |
76 | struct sigaltstack pr_altstack; /* Alternate stack info. */ | |
77 | struct sigaction pr_action; /* Signal action for current sig. */ | |
78 | #endif | |
79 | __pid_t pr_pid; | |
80 | __pid_t pr_ppid; | |
81 | __pid_t pr_pgrp; | |
82 | __pid_t pr_sid; | |
83 | struct timeval pr_utime; /* User time. */ | |
84 | struct timeval pr_stime; /* System time. */ | |
85 | struct timeval pr_cutime; /* Cumulative user time. */ | |
86 | struct timeval pr_cstime; /* Cumulative system time. */ | |
87 | #if 0 | |
88 | long int pr_instr; /* Current instruction. */ | |
89 | #endif | |
90 | elf_gregset_t pr_reg; /* GP registers. */ | |
91 | int pr_fpvalid; /* True if math copro being used. */ | |
92 | }; | |
93 | ||
94 | ||
95 | #define ELF_PRARGSZ (80) /* Number of chars for args */ | |
96 | ||
97 | struct elf_prpsinfo | |
98 | { | |
99 | char pr_state; /* Numeric process state. */ | |
100 | char pr_sname; /* Char for pr_state. */ | |
101 | char pr_zomb; /* Zombie. */ | |
102 | char pr_nice; /* Nice val. */ | |
103 | unsigned long int pr_flag; /* Flags. */ | |
104 | unsigned int pr_uid; | |
105 | unsigned int pr_gid; | |
106 | int pr_pid, pr_ppid, pr_pgrp, pr_sid; | |
107 | /* Lots missing */ | |
108 | char pr_fname[16]; /* Filename of executable. */ | |
109 | char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ | |
110 | }; | |
111 | ||
112 | /* Addresses. */ | |
113 | typedef void *psaddr_t; | |
114 | ||
115 | /* Register sets. Linux has different names. */ | |
116 | typedef gregset_t prgregset_t; | |
117 | typedef fpregset_t prfpregset_t; | |
118 | ||
119 | /* We don't have any differences between processes and threads, | |
120 | therefore habe only ine PID type. */ | |
121 | typedef __pid_t lwpid_t; | |
122 | ||
123 | ||
124 | typedef struct elf_prstatus prstatus_t; | |
125 | typedef struct elf_prpsinfo prpsinfo_t; | |
126 | ||
127 | __END_DECLS | |
128 | ||
129 | #endif /* sys/procfs.h */ |