]>
Commit | Line | Data |
---|---|---|
8ea4d2b7 JM |
1 | /* Definitions for core files and libthread_db. Generic Linux version. |
2 | Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
3 | ||
8a4b65b4 | 4 | This file is part of the GNU C Library. |
b33f91e9 | 5 | |
8a4b65b4 | 6 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
b33f91e9 | 10 | |
8a4b65b4 UD |
11 | The GNU C Library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
b33f91e9 | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
b33f91e9 UD |
19 | |
20 | #ifndef _SYS_PROCFS_H | |
b33f91e9 | 21 | #define _SYS_PROCFS_H 1 |
b33f91e9 | 22 | |
8ea4d2b7 | 23 | /* This is somewhat modelled after the file of the same name on SVR4 |
b33f91e9 | 24 | systems. It provides a definition of the core file format for ELF |
8ea4d2b7 JM |
25 | used on Linux. It doesn't have anything to do with the /proc file |
26 | system, even though Linux has one. | |
27 | ||
28 | Anyway, the whole purpose of this file is for GDB and GDB only. | |
29 | Don't read too much into it. Don't use it for anything other than | |
30 | GDB unless you know what you are doing. */ | |
b33f91e9 | 31 | |
a680290a | 32 | #include <features.h> |
b33f91e9 UD |
33 | #include <sys/time.h> |
34 | #include <sys/types.h> | |
648c1337 | 35 | #include <sys/user.h> |
8ea4d2b7 JM |
36 | |
37 | /* bits/procfs.h, provided by each architecture, must define | |
38 | elf_gregset_t, elf_fpregset_t and any other architecture-specific | |
39 | types needed. */ | |
40 | #include <bits/procfs.h> | |
b33f91e9 | 41 | |
d0d8eb43 JM |
42 | /* bits/procfs-id.h must define __pr_uid_t and __pr_gid_t, the types |
43 | of pr_uid and pr_gid. */ | |
44 | #include <bits/procfs-id.h> | |
45 | ||
8a4b65b4 UD |
46 | __BEGIN_DECLS |
47 | ||
8ea4d2b7 | 48 | /* Signal info. */ |
b33f91e9 | 49 | struct elf_siginfo |
5290baf0 UD |
50 | { |
51 | int si_signo; /* Signal number. */ | |
52 | int si_code; /* Extra code. */ | |
53 | int si_errno; /* Errno. */ | |
54 | }; | |
b33f91e9 | 55 | |
b33f91e9 UD |
56 | /* Definitions to generate Intel SVR4-like core files. These mostly |
57 | have the same names as the SVR4 types with "elf_" tacked on the | |
8ea4d2b7 | 58 | front to prevent clashes with Linux definitions, and the typedef |
b33f91e9 UD |
59 | forms have been avoided. This is mostly like the SVR4 structure, |
60 | but more Linuxy, with things that Linux does not support and which | |
8ea4d2b7 JM |
61 | GDB doesn't really use excluded. */ |
62 | ||
b33f91e9 | 63 | struct elf_prstatus |
5290baf0 | 64 | { |
5290baf0 UD |
65 | struct elf_siginfo pr_info; /* Info associated with signal. */ |
66 | short int pr_cursig; /* Current signal. */ | |
67 | unsigned long int pr_sigpend; /* Set of pending signals. */ | |
68 | unsigned long int pr_sighold; /* Set of held signals. */ | |
5290baf0 UD |
69 | __pid_t pr_pid; |
70 | __pid_t pr_ppid; | |
71 | __pid_t pr_pgrp; | |
72 | __pid_t pr_sid; | |
73 | struct timeval pr_utime; /* User time. */ | |
74 | struct timeval pr_stime; /* System time. */ | |
75 | struct timeval pr_cutime; /* Cumulative user time. */ | |
76 | struct timeval pr_cstime; /* Cumulative system time. */ | |
5290baf0 UD |
77 | elf_gregset_t pr_reg; /* GP registers. */ |
78 | int pr_fpvalid; /* True if math copro being used. */ | |
79 | }; | |
b33f91e9 UD |
80 | |
81 | ||
8ea4d2b7 | 82 | #define ELF_PRARGSZ (80) /* Number of chars for args. */ |
b33f91e9 UD |
83 | |
84 | struct elf_prpsinfo | |
5290baf0 UD |
85 | { |
86 | char pr_state; /* Numeric process state. */ | |
87 | char pr_sname; /* Char for pr_state. */ | |
88 | char pr_zomb; /* Zombie. */ | |
89 | char pr_nice; /* Nice val. */ | |
90 | unsigned long int pr_flag; /* Flags. */ | |
d0d8eb43 JM |
91 | __pr_uid_t pr_uid; |
92 | __pr_gid_t pr_gid; | |
8d57beea | 93 | int pr_pid, pr_ppid, pr_pgrp, pr_sid; |
5290baf0 UD |
94 | /* Lots missing */ |
95 | char pr_fname[16]; /* Filename of executable. */ | |
96 | char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ | |
97 | }; | |
b33f91e9 | 98 | |
8ea4d2b7 JM |
99 | /* The rest of this file provides the types for emulation of the |
100 | Solaris <proc_service.h> interfaces that should be implemented by | |
101 | users of libthread_db. */ | |
102 | ||
a680290a UD |
103 | /* Addresses. */ |
104 | typedef void *psaddr_t; | |
105 | ||
106 | /* Register sets. Linux has different names. */ | |
8ea4d2b7 JM |
107 | typedef elf_gregset_t prgregset_t; |
108 | typedef elf_fpregset_t prfpregset_t; | |
a680290a UD |
109 | |
110 | /* We don't have any differences between processes and threads, | |
8ea4d2b7 | 111 | therefore have only one PID type. */ |
a680290a UD |
112 | typedef __pid_t lwpid_t; |
113 | ||
8ea4d2b7 | 114 | /* Process status and info. In the end we do provide typedefs for them. */ |
b33f91e9 UD |
115 | typedef struct elf_prstatus prstatus_t; |
116 | typedef struct elf_prpsinfo prpsinfo_t; | |
117 | ||
8a4b65b4 | 118 | __END_DECLS |
b33f91e9 | 119 | |
d0d8eb43 JM |
120 | /* On some architectures, provide other-ABI variants of the above |
121 | types. */ | |
122 | #include <bits/procfs-extra.h> | |
123 | ||
8ea4d2b7 | 124 | #endif /* sys/procfs.h. */ |