Back to index

glibc  2.9
procfs.h
Go to the documentation of this file.
00001 /* Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
00002        Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_PROCFS_H
00021 #define _SYS_PROCFS_H       1
00022 
00023 /* This is somehow modelled after the file of the same name on SysVr4
00024    systems.  It provides a definition of the core file format for ELF
00025    used on Linux.  */
00026 
00027 #include <features.h>
00028 #include <sgidefs.h>
00029 #include <sys/time.h>
00030 #include <sys/types.h>
00031 #include <sys/user.h>
00032 #include <sgidefs.h>
00033 
00034 /* ELF register definitions */
00035 #define ELF_NGREG    45
00036 #define ELF_NFPREG   33
00037 
00038 #if _MIPS_SIM == _ABIN32
00039 __extension__ typedef unsigned long long elf_greg_t;
00040 #else
00041 typedef unsigned long elf_greg_t;
00042 #endif
00043 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
00044 
00045 typedef double elf_fpreg_t;
00046 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
00047 
00048 __BEGIN_DECLS
00049 
00050 struct elf_siginfo
00051   {
00052     int si_signo;                  /* Signal number.  */
00053     int si_code;                   /* Extra code.  */
00054     int si_errno;                  /* Errno.  */
00055   };
00056 
00057 
00058 /* Definitions to generate Intel SVR4-like core files.  These mostly
00059    have the same names as the SVR4 types with "elf_" tacked on the
00060    front to prevent clashes with linux definitions, and the typedef
00061    forms have been avoided.  This is mostly like the SVR4 structure,
00062    but more Linuxy, with things that Linux does not support and which
00063    gdb doesn't really use excluded.  Fields present but not used are
00064    marked with "XXX".  */
00065 struct elf_prstatus
00066   {
00067     struct elf_siginfo pr_info;           /* Info associated with signal.  */
00068     short int pr_cursig;           /* Current signal.  */
00069 #if _MIPS_SIM == _ABIN32
00070     __extension__ unsigned long long int pr_sigpend;
00071     __extension__ unsigned long long int pr_sighold;
00072 #else
00073     unsigned long int pr_sigpend;  /* Set of pending signals.  */
00074     unsigned long int pr_sighold;  /* Set of held signals.  */
00075 #endif
00076     __pid_t pr_pid;
00077     __pid_t pr_ppid;
00078     __pid_t pr_pgrp;
00079     __pid_t pr_sid;
00080     struct timeval pr_utime;              /* User time.  */
00081     struct timeval pr_stime;              /* System time.  */
00082     struct timeval pr_cutime;             /* Cumulative user time.  */
00083     struct timeval pr_cstime;             /* Cumulative system time.  */
00084     elf_gregset_t pr_reg;          /* GP registers.  */
00085     int pr_fpvalid;                /* True if math copro being used.  */
00086   };
00087 
00088 
00089 #define ELF_PRARGSZ     (80)    /* Number of chars for args */
00090 
00091 struct elf_prpsinfo
00092   {
00093     char pr_state;                 /* Numeric process state.  */
00094     char pr_sname;                 /* Char for pr_state.  */
00095     char pr_zomb;                  /* Zombie.  */
00096     char pr_nice;                  /* Nice val.  */
00097 #if _MIPS_SIM == _ABIN32
00098     __extension__ unsigned long long int pr_flag;
00099 #else
00100     unsigned long int pr_flag;            /* Flags.  */
00101 #endif
00102     long pr_uid;
00103     long pr_gid;
00104     int pr_pid, pr_ppid, pr_pgrp, pr_sid;
00105     /* Lots missing */
00106     char pr_fname[16];                    /* Filename of executable.  */
00107     char pr_psargs[ELF_PRARGSZ];   /* Initial part of arg list.  */
00108   };
00109 
00110 
00111 /* Addresses.  */
00112 typedef void *psaddr_t;
00113 
00114 /* Register sets.  Linux has different names.  */
00115 typedef elf_gregset_t prgregset_t;
00116 typedef elf_fpregset_t prfpregset_t;
00117 
00118 /* We don't have any differences between processes and threads,
00119    therefore habe only ine PID type.  */
00120 typedef __pid_t lwpid_t;
00121 
00122 
00123 typedef struct elf_prstatus prstatus_t;
00124 typedef struct elf_prpsinfo prpsinfo_t;
00125 
00126 __END_DECLS
00127 
00128 #endif /* sys/procfs.h */