Blame sysdeps/unix/sysv/linux/sys/procfs.h

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 <asm/elf.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
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
#if 0
Packit 6c4009
    long int pr_flags;			/* XXX Process flags.  */
Packit 6c4009
    short int pr_why;			/* XXX Reason for process halt.  */
Packit 6c4009
    short int pr_what;			/* XXX More detailed reason.  */
Packit 6c4009
#endif
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
#if 0
Packit 6c4009
    stack_t pr_altstack;		/* Alternate stack info.  */
Packit 6c4009
    struct sigaction pr_action;		/* Signal action for current sig.  */
Packit 6c4009
#endif
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
#if 0
Packit 6c4009
    long int pr_instr;			/* Current instruction.  */
Packit 6c4009
#endif
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
    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
/* Addresses.  */
Packit 6c4009
typedef void *psaddr_t;
Packit 6c4009
Packit 6c4009
/* Register sets.  Linux has different names.  */
Packit 6c4009
typedef gregset_t prgregset_t;
Packit 6c4009
typedef fpregset_t prfpregset_t;
Packit 6c4009
Packit 6c4009
/* We don't have any differences between processes and threads,
Packit 6c4009
   therefore habe only ine 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
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* sys/procfs.h */