old_procfs.h revision 2c797a4e2b3df5a8d31d47a9b5bea4cde7005e9d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_OLD_PROCFS_H
#define _SYS_OLD_PROCFS_H
/*
* This file contains the definitions for the old ioctl()-based
* version of the process file system. It is obsolete but will
* continue to be supported in SunOS until the next major release.
*/
#include <sys/time_impl.h>
#include <sys/procfs_isa.h>
#ifdef __cplusplus
extern "C" {
#endif
#error "Cannot use procfs in the large file compilation environment"
#endif
#if _STRUCTURED_PROC == 0
/*
* The old (ioctl-based) and new (structured) /proc interfaces define
* related structures of the same name, but slightly diferent contents:
* prmap_t
* prcred_t
* This doesn't hurt because you can't include both of these
* in the same compilation unit:
* <sys/old_procfs.h>
* unless _STRUCTURED_PROC is first defined to be 1.
* (Including <procfs.h> defines it to be 1.)
*
* However, the latest version of lint goes overboard in hunting
* down and reporting differences in functions and data of the
* same name across multiple compilation units, even though there
* is no real problem. To mitigate this, we redefine the old procfs
* names when performing lint.
*/
#if defined(__lint)
#endif /* __lint */
/*
* ioctl codes and system call interfaces for /proc.
*/
/*
*/
/*
* These are new with SunOS5.0.
*/
/*
* Lightweight process interfaces.
*/
/*
* SVR4 run-time loader interfaces.
*/
/*
* extra register state interfaces
*/
/*
* Intel-specific interfaces.
*/
#endif /* _STRUCTURED_PROC == 0 */
typedef struct prstatus {
int pr_flags; /* Flags (see below) */
short pr_why; /* Reason for process stop (if stopped) */
short pr_what; /* More detailed reason */
short pr_cursig; /* Current signal */
short pr_syscall; /* System call number (if in syscall) */
short pr_nsysarg; /* Number of arguments to this syscall */
short pr_processor; /* processor which last ran this LWP */
short pr_bind; /* processor LWP bound to or PBIND_NONE */
long pr_instr; /* Current instruction */
} prstatus_t;
#if _STRUCTURED_PROC == 0
/* pr_flags */
/* Reasons for stopping */
#define PR_REQUESTED 1
#define PR_SIGNALLED 2
#define PR_SYSENTRY 3
#define PR_SYSEXIT 4
#define PR_JOBCONTROL 5
#define PR_FAULTED 6
#define PR_SUSPENDED 7
#define PR_CHECKPOINT 8
/* Information for the ps(1) command */
#endif /* _STRUCTURED_PROC == 0 */
typedef struct prpsinfo {
char pr_state; /* numeric process state (see pr_sname) */
char pr_sname; /* printable character representing pr_state */
char pr_zomb; /* !=0: process terminated but not waited for */
char pr_nice; /* nice for cpu usage */
int pr_pri; /* priority, high value is high priority */
char pr_oldpri; /* pre-SVR4, low value is high priority */
char pr_cpu; /* pre-SVR4, cpu usage for scheduling */
short pr_syscall; /* system call number (if in syscall) */
short pr_fill;
int pr_argc; /* initial argument count */
char **pr_argv; /* initial argument vector */
char **pr_envp; /* initial environment vector */
int pr_wstat; /* if zombie, the wait() status */
/* The following percent numbers are 16-bit binary */
/* fractions [0 .. 1] with the binary point to the */
/* right of the high-order bit (one == 0x8000) */
char pr_dmodel; /* data model of the process */
char pr_pad[3];
} prpsinfo_t;
#if _STRUCTURED_PROC == 0
#if !defined(_STYPES)
#define pr_ttydev pr_lttydev
#else
#define pr_ttydev pr_ottydev
#endif
/*
* See <sys/procfs_isa.h> for possible values of pr_dmodel.
*/
/* Optional actions to take when process continues */
typedef struct prrun {
int pr_flags; /* Flags */
} prrun_t;
/* Memory-management interface */
typedef struct prmap {
} prmap_t;
/* Protection and attribute flags */
/*
* These are obsolete and unreliable.
* They are included here only for historical compatibility.
*/
/* Process credentials */
typedef struct prcred {
} prcred_t;
/* Resource usage */
typedef struct prusage {
int pr_count; /* number of contributing lwps */
} prusage_t;
/* Page data */
/* page data file header */
typedef struct prpageheader {
/* page data mapping header */
typedef struct prasmap {
} prasmap_t;
/*
* npage bytes (rounded up to a sizeof (long)-byte boundary) follow
* each mapping header, containing zero or more of these flags.
*/
/*
* Macros for manipulating sets of flags.
* sp must be a pointer to one of sigset_t, fltset_t, or sysset_t.
* flag must be a member of the enumeration corresponding to *sp.
*/
/* turn on all flags in set */
/* turn off all flags in set */
#define premptyset(sp) \
/* turn on specified flag in set */
/* turn off specified flag in set */
/* query: != 0 iff flag is turned on in set */
#endif /* _STRUCTURED_PROC == 0 */
#ifdef _SYSCALL32
#if _STRUCTURED_PROC == 0
/*
* dev32_t version of PRNODEV
*/
/*
* Kernel view of structures used by _ILP32 programs.
*/
#endif /* _STRUCTURED_PROC == 0 */
typedef struct prstatus32 {
short pr_why; /* Reason for process stop (if stopped) */
short pr_what; /* More detailed reason */
short pr_cursig; /* Current signal */
short pr_syscall; /* System call number (if in syscall) */
short pr_nsysarg; /* Number of arguments to this syscall */
short pr_processor; /* processor which last ran this LWP */
short pr_bind; /* processor LWP bound to or PBIND_NONE */
} prstatus32_t;
typedef struct prpsinfo32 {
char pr_state; /* numeric process state (see pr_sname) */
char pr_sname; /* printable character representing pr_state */
char pr_zomb; /* !=0: process terminated but not waited for */
char pr_nice; /* nice for cpu usage */
char pr_oldpri; /* pre-SVR4, low value is high priority */
char pr_cpu; /* pre-SVR4, cpu usage for scheduling */
short pr_syscall; /* system call number (if in syscall) */
short pr_fill;
int pr_argc; /* initial argument count */
int pr_wstat; /* if zombie, the wait() status */
char pr_dmodel; /* data model of the process */
char pr_pad[3];
} prpsinfo32_t;
#if _STRUCTURED_PROC == 0
typedef struct prrun32 {
} prrun32_t;
typedef struct ioc_prmap32 {
typedef struct prusage32 {
} prusage32_t;
typedef struct ioc_prpageheader32 {
typedef struct ioc_prasmap32 {
#endif /* _STRUCTURED_PROC == 0 */
#endif /* _SYSCALL32 */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_OLD_PROCFS_H */