|
Packit |
6c4009 |
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _SYS_PROCFS_H
|
|
Packit |
6c4009 |
#define _SYS_PROCFS_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This is somehow modelled after the file of the same name on SysVr4
|
|
Packit |
6c4009 |
systems. It provides a definition of the core file format for ELF
|
|
Packit |
6c4009 |
used on Linux. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <features.h>
|
|
Packit |
6c4009 |
#include <signal.h>
|
|
Packit |
6c4009 |
#include <sys/time.h>
|
|
Packit |
6c4009 |
#include <sys/types.h>
|
|
Packit |
6c4009 |
#include <sys/ucontext.h>
|
|
Packit |
6c4009 |
#include <sys/user.h>
|
|
Packit |
6c4009 |
#include <bits/wordsize.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__BEGIN_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if __WORDSIZE == 64
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define ELF_NGREG 36
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
unsigned long pr_regs[32];
|
|
Packit |
6c4009 |
unsigned long pr_fsr;
|
|
Packit |
6c4009 |
unsigned long pr_gsr;
|
|
Packit |
6c4009 |
unsigned long pr_fprs;
|
|
Packit |
6c4009 |
} elf_fpregset_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#else /* sparc32 */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define ELF_NGREG 38
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
union
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
unsigned long pr_regs[32];
|
|
Packit |
6c4009 |
double pr_dregs[16];
|
|
Packit |
6c4009 |
} pr_fr;
|
|
Packit |
6c4009 |
unsigned long __glibc_reserved;
|
|
Packit |
6c4009 |
unsigned long pr_fsr;
|
|
Packit |
6c4009 |
unsigned char pr_qcnt;
|
|
Packit |
6c4009 |
unsigned char pr_q_entrysize;
|
|
Packit |
6c4009 |
unsigned char pr_en;
|
|
Packit |
6c4009 |
unsigned int pr_q[64];
|
|
Packit |
6c4009 |
} elf_fpregset_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* sparc32 */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef unsigned long elf_greg_t;
|
|
Packit |
6c4009 |
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_siginfo
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
int si_signo; /* Signal number. */
|
|
Packit |
6c4009 |
int si_code; /* Extra code. */
|
|
Packit |
6c4009 |
int si_errno; /* Errno. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Definitions to generate Intel SVR4-like core files. These mostly
|
|
Packit |
6c4009 |
have the same names as the SVR4 types with "elf_" tacked on the
|
|
Packit |
6c4009 |
front to prevent clashes with linux definitions, and the typedef
|
|
Packit |
6c4009 |
forms have been avoided. This is mostly like the SVR4 structure,
|
|
Packit |
6c4009 |
but more Linuxy, with things that Linux does not support and which
|
|
Packit |
6c4009 |
gdb doesn't really use excluded. Fields present but not used are
|
|
Packit |
6c4009 |
marked with "XXX". */
|
|
Packit |
6c4009 |
struct elf_prstatus
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
struct elf_siginfo pr_info; /* Info associated with signal. */
|
|
Packit |
6c4009 |
short int pr_cursig; /* Current signal. */
|
|
Packit |
6c4009 |
unsigned long int pr_sigpend; /* Set of pending signals. */
|
|
Packit |
6c4009 |
unsigned long int pr_sighold; /* Set of held signals. */
|
|
Packit |
6c4009 |
__pid_t pr_pid;
|
|
Packit |
6c4009 |
__pid_t pr_ppid;
|
|
Packit |
6c4009 |
__pid_t pr_pgrp;
|
|
Packit |
6c4009 |
__pid_t pr_sid;
|
|
Packit |
6c4009 |
struct timeval pr_utime; /* User time. */
|
|
Packit |
6c4009 |
struct timeval pr_stime; /* System time. */
|
|
Packit |
6c4009 |
struct timeval pr_cutime; /* Cumulative user time. */
|
|
Packit |
6c4009 |
struct timeval pr_cstime; /* Cumulative system time. */
|
|
Packit |
6c4009 |
elf_gregset_t pr_reg; /* GP registers. */
|
|
Packit |
6c4009 |
int pr_fpvalid; /* True if math copro being used. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define ELF_PRARGSZ (80) /* Number of chars for args */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_prpsinfo
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
char pr_state; /* Numeric process state. */
|
|
Packit |
6c4009 |
char pr_sname; /* Char for pr_state. */
|
|
Packit |
6c4009 |
char pr_zomb; /* Zombie. */
|
|
Packit |
6c4009 |
char pr_nice; /* Nice val. */
|
|
Packit |
6c4009 |
unsigned long int pr_flag; /* Flags. */
|
|
Packit |
6c4009 |
#if __WORDSIZE == 64
|
|
Packit |
6c4009 |
unsigned int pr_uid;
|
|
Packit |
6c4009 |
unsigned int pr_gid;
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
unsigned short int pr_uid;
|
|
Packit |
6c4009 |
unsigned short int pr_gid;
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
|
Packit |
6c4009 |
/* Lots missing */
|
|
Packit |
6c4009 |
char pr_fname[16]; /* Filename of executable. */
|
|
Packit |
6c4009 |
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Addresses. */
|
|
Packit |
6c4009 |
typedef void *psaddr_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Register sets. Linux has different names. */
|
|
Packit |
6c4009 |
typedef elf_gregset_t prgregset_t;
|
|
Packit |
6c4009 |
typedef elf_fpregset_t prfpregset_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* We don't have any differences between processes and threads,
|
|
Packit |
6c4009 |
therefore have only one PID type. */
|
|
Packit |
6c4009 |
typedef __pid_t lwpid_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct elf_prstatus prstatus_t;
|
|
Packit |
6c4009 |
typedef struct elf_prpsinfo prpsinfo_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if __WORDSIZE == 64
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Provide 32-bit variants so that BFD can read 32-bit
|
|
Packit |
6c4009 |
core files. */
|
|
Packit |
6c4009 |
#define ELF_NGREG32 38
|
|
Packit |
6c4009 |
typedef struct
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
union
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
unsigned int pr_regs[32];
|
|
Packit |
6c4009 |
double pr_dregs[16];
|
|
Packit |
6c4009 |
} pr_fr;
|
|
Packit |
6c4009 |
unsigned int __glibc_reserved;
|
|
Packit |
6c4009 |
unsigned int pr_fsr;
|
|
Packit |
6c4009 |
unsigned char pr_qcnt;
|
|
Packit |
6c4009 |
unsigned char pr_q_entrysize;
|
|
Packit |
6c4009 |
unsigned char pr_en;
|
|
Packit |
6c4009 |
unsigned int pr_q[64];
|
|
Packit |
6c4009 |
} elf_fpregset_t32;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef unsigned int elf_greg_t32;
|
|
Packit |
6c4009 |
typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32];
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_prstatus32
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
struct elf_siginfo pr_info; /* Info associated with signal. */
|
|
Packit |
6c4009 |
short int pr_cursig; /* Current signal. */
|
|
Packit |
6c4009 |
unsigned int pr_sigpend; /* Set of pending signals. */
|
|
Packit |
6c4009 |
unsigned int pr_sighold; /* Set of held signals. */
|
|
Packit |
6c4009 |
__pid_t pr_pid;
|
|
Packit |
6c4009 |
__pid_t pr_ppid;
|
|
Packit |
6c4009 |
__pid_t pr_pgrp;
|
|
Packit |
6c4009 |
__pid_t pr_sid;
|
|
Packit |
6c4009 |
struct
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
int tv_sec, tv_usec;
|
|
Packit |
6c4009 |
} pr_utime, /* User time. */
|
|
Packit |
6c4009 |
pr_stime, /* System time. */
|
|
Packit |
6c4009 |
pr_cutime, /* Cumulative user time. */
|
|
Packit |
6c4009 |
pr_cstime; /* Cumulative system time. */
|
|
Packit |
6c4009 |
elf_gregset_t32 pr_reg; /* GP registers. */
|
|
Packit |
6c4009 |
int pr_fpvalid; /* True if math copro being used. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct elf_prpsinfo32
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
char pr_state; /* Numeric process state. */
|
|
Packit |
6c4009 |
char pr_sname; /* Char for pr_state. */
|
|
Packit |
6c4009 |
char pr_zomb; /* Zombie. */
|
|
Packit |
6c4009 |
char pr_nice; /* Nice val. */
|
|
Packit |
6c4009 |
unsigned int pr_flag; /* Flags. */
|
|
Packit |
6c4009 |
unsigned short int pr_uid;
|
|
Packit |
6c4009 |
unsigned short int pr_gid;
|
|
Packit |
6c4009 |
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
|
|
Packit |
6c4009 |
/* Lots missing */
|
|
Packit |
6c4009 |
char pr_fname[16]; /* Filename of executable. */
|
|
Packit |
6c4009 |
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef elf_gregset_t32 prgregset32_t;
|
|
Packit |
6c4009 |
typedef elf_fpregset_t32 prfpregset32_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
typedef struct elf_prstatus32 prstatus32_t;
|
|
Packit |
6c4009 |
typedef struct elf_prpsinfo32 prpsinfo32_t;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* sparc64 */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__END_DECLS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* sys/procfs.h */
|