Dr Andrew Scott G7VAV

My photo
 
May 2024
Mo Tu We Th Fr Sa Su
29 30 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 1 2
3 4 5 6 7 8 9


procfs.h
001: /* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
002:    This file is part of the GNU C Library.
003: 
004:    The GNU C Library is free software; you can redistribute it and/or
005:    modify it under the terms of the GNU Lesser General Public
006:    License as published by the Free Software Foundation; either
007:    version 2.1 of the License, or (at your option) any later version.
008: 
009:    The GNU C Library is distributed in the hope that it will be useful,
010:    but WITHOUT ANY WARRANTY; without even the implied warranty of
011:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:    Lesser General Public License for more details.
013: 
014:    You should have received a copy of the GNU Lesser General Public
015:    License along with the GNU C Library; if not, write to the Free
016:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
017:    02111-1307 USA.  */
018: 
019: #ifndef _SYS_PROCFS_H
020: #define _SYS_PROCFS_H   1
021: 
022: /* This is somewhat modelled after the file of the same name on SVR4
023:    systems.  It provides a definition of the core file format for ELF
024:    used on Linux.  It doesn't have anything to do with the /proc file
025:    system, even though Linux has one.
026: 
027:    Anyway, the whole purpose of this file is for GDB and GDB only.
028:    Don't read too much into it.  Don't use it for anything other than
029:    GDB unless you know what you are doing.  */
030: 
031: #include <features.h>
032: #include <sys/time.h>
033: #include <sys/types.h>
034: #include <sys/user.h>
035: 
036: __BEGIN_DECLS
037: 
038: /* Type for a general-purpose register.  */
039: typedef unsigned long elf_greg_t;
040: 
041: /* And the whole bunch of them.  We could have used `struct
042:    user_regs_struct' directly in the typedef, but tradition says that
043:    the register set is an array, which does have some peculiar
044:    semantics, so leave it that way.  */
045: #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
046: typedef elf_greg_t elf_gregset_t[ELF_NGREG];
047: 
048: #if __WORDSIZE == 32
049: /* Register set for the floating-point registers.  */
050: typedef struct user_fpregs_struct elf_fpregset_t;
051: 
052: /* Register set for the extended floating-point registers.  Includes
053:    the Pentium III SSE registers in addition to the classic
054:    floating-point stuff.  */
055: typedef struct user_fpxregs_struct elf_fpxregset_t;
056: #else
057: /* Register set for the extended floating-point registers.  Includes
058:    the Pentium III SSE registers in addition to the classic
059:    floating-point stuff.  */
060: typedef struct user_fpregs_struct elf_fpregset_t;
061: #endif
062: 
063: /* Signal info.  */
064: struct elf_siginfo
065:   {
066:     int si_signo;                       /* Signal number.  */
067:     int si_code;                        /* Extra code.  */
068:     int si_errno;                       /* Errno.  */
069:   };
070: 
071: 
072: /* Definitions to generate Intel SVR4-like core files.  These mostly
073:    have the same names as the SVR4 types with "elf_" tacked on the
074:    front to prevent clashes with Linux definitions, and the typedef
075:    forms have been avoided.  This is mostly like the SVR4 structure,
076:    but more Linuxy, with things that Linux does not support and which
077:    GDB doesn't really use excluded.  */
078: 
079: struct elf_prstatus
080:   {
081:     struct elf_siginfo pr_info;         /* Info associated with signal.  */
082:     short int pr_cursig;                /* Current signal.  */
083:     unsigned long int pr_sigpend;       /* Set of pending signals.  */
084:     unsigned long int pr_sighold;       /* Set of held signals.  */
085:     __pid_t pr_pid;
086:     __pid_t pr_ppid;
087:     __pid_t pr_pgrp;
088:     __pid_t pr_sid;
089:     struct timeval pr_utime;            /* User time.  */
090:     struct timeval pr_stime;            /* System time.  */
091:     struct timeval pr_cutime;           /* Cumulative user time.  */
092:     struct timeval pr_cstime;           /* Cumulative system time.  */
093:     elf_gregset_t pr_reg;               /* GP registers.  */
094:     int pr_fpvalid;                     /* True if math copro being used.  */
095:   };
096: 
097: 
098: #define ELF_PRARGSZ     (80)    /* Number of chars for args.  */
099: 
100: struct elf_prpsinfo
101:   {
102:     char pr_state;                      /* Numeric process state.  */
103:     char pr_sname;                      /* Char for pr_state.  */
104:     char pr_zomb;                       /* Zombie.  */
105:     char pr_nice;                       /* Nice val.  */
106:     unsigned long int pr_flag;          /* Flags.  */
107: #if __WORDSIZE == 32
108:     unsigned short int pr_uid;
109:     unsigned short int pr_gid;
110: #else
111:     unsigned int pr_uid;
112:     unsigned int pr_gid;
113: #endif
114:     int pr_pid, pr_ppid, pr_pgrp, pr_sid;
115:     /* Lots missing */
116:     char pr_fname[16];                  /* Filename of executable.  */
117:     char pr_psargs[ELF_PRARGSZ];        /* Initial part of arg list.  */
118:   };
119: 
120: 
121: /* The rest of this file provides the types for emulation of the
122:    Solaris <proc_service.h> interfaces that should be implemented by
123:    users of libthread_db.  */
124: 
125: /* Addresses.  */
126: typedef void *psaddr_t;
127: 
128: /* Register sets.  Linux has different names.  */
129: typedef elf_gregset_t prgregset_t;
130: typedef elf_fpregset_t prfpregset_t;
131: 
132: /* We don't have any differences between processes and threads,
133:    therefore have only one PID type.  */
134: typedef __pid_t lwpid_t;
135: 
136: /* Process status and info.  In the end we do provide typedefs for them.  */
137: typedef struct elf_prstatus prstatus_t;
138: typedef struct elf_prpsinfo prpsinfo_t;
139: 
140: __END_DECLS
141: 
142: #endif  /* sys/procfs.h */
143: 


for client 3.144.86.138
© Andrew Scott 2006 - 2024,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/