#include <sys/proc.h>

sys/proc.h

includes: sys/appleapiopts.h, sys/cdefs.h, sys/select.h, sys/queue.h, sys/lock.h, sys/param.h, sys/event.h, sys/time.h, mach/boolean.h, Availability.h
61 macros · 1 struct

structextern_proc

Exported fields for kern sysctls
size 296, align 8
unnamed union at sys/proc.h:92:2p_un
unnamed struct at sys/proc.h:93:3p_st1
struct proc *__p_forwDoubly-linked run/sleep queue.
struct proc *__p_back
struct timeval__p_starttimeprocess start time
struct vmspace *p_vmspaceAddress space.
struct sigacts *p_sigactsSignal actions, state (PROC ONLY).
intp_flagP_* flags.
charp_statS* process status.
pid_tp_pidProcess identifier.
pid_tp_oppidSave parent pid during ptrace. XXX
intp_dupfdSideways return value from fdopen. XXX
caddr_tuser_stackMach related where user stack was allocated
void *exit_threadXXX Which thread is exiting?
intp_debuggerallow to debug
boolean_tsigwaitindication to suspend
u_intp_estcpuscheduling Time averaged value of p_cpticks.
intp_cpticksTicks of cpu time.
fixpt_tp_pctcpu%cpu for this process during p_swtime
void *p_wchanSleep address.
char *p_wmesgReason for sleep.
u_intp_swtimeTime swapped in or out.
u_intp_slptimeTime since last blocked.
struct itimervalp_realtimerAlarm timer.
struct timevalp_rtimeReal time.
u_quad_tp_uticksStatclock hits in user mode.
u_quad_tp_sticksStatclock hits in system mode.
u_quad_tp_iticksStatclock hits processing intr.
intp_traceflagKernel trace points.
struct vnode *p_tracepTrace to vnode.
intp_siglistDEPRECATED.
struct vnode *p_textvpVnode of executable.
intp_holdcntIf non-zero, don't swap.
sigset_tp_sigmaskDEPRECATED.
sigset_tp_sigignoreSignals being ignored.
sigset_tp_sigcatchSignals being caught by user.
u_charp_priorityProcess priority.
u_charp_usrpriUser-priority based on p_cpu and p_nice.
charp_niceProcess "nice" value.
char[17]p_comm
struct pgrp *p_pgrpPointer to process group.
struct user *p_addrKernel virtual addr of u-area (PROC ONLY).
u_shortp_xstatExit status for wait; also stop signal.
u_shortp_acflagAccounting flags.
struct rusage *p_ruExit information. XXX

macrop_forw

#define p_forw p_un.p_st1.__p_forw

macrop_back

#define p_back p_un.p_st1.__p_back

macrop_starttime

#define p_starttime p_un.__p_starttime

macroSIDL

Status values.
#define SIDL 1
Process being created by fork.

macroSRUN

#define SRUN 2
Currently runnable.

macroSSLEEP

#define SSLEEP 3
Sleeping on an address.

macroSSTOP

#define SSTOP 4
Process debugging or suspension.

macroSZOMB

#define SZOMB 5
Awaiting collection by parent.

macroP_ADVLOCK

These flags are kept in extern_proc.p_flag.
#define P_ADVLOCK 0x00000001
Process may hold POSIX adv. lock

macroP_CONTROLT

#define P_CONTROLT 0x00000002
Has a controlling terminal

macroP_LP64

#define P_LP64 0x00000004
Process is LP64

macroP_NOCLDSTOP

#define P_NOCLDSTOP 0x00000008
No SIGCHLD when children stop

macroP_PPWAIT

#define P_PPWAIT 0x00000010
Parent waiting for chld exec/exit

macroP_PROFIL

#define P_PROFIL 0x00000020
Has started profiling

macroP_SELECT

#define P_SELECT 0x00000040
Selecting; wakeup/waiting danger

macroP_CONTINUED

#define P_CONTINUED 0x00000080
Process was stopped and continued

macroP_SUGID

#define P_SUGID 0x00000100
Has set privileges since last exec

macroP_SYSTEM

#define P_SYSTEM 0x00000200
Sys proc: no sigs, stats or swap

macroP_TIMEOUT

#define P_TIMEOUT 0x00000400
Timing out during sleep

macroP_TRACED

#define P_TRACED 0x00000800
Debugged process being traced

macroP_DISABLE_ASLR

#define P_DISABLE_ASLR 0x00001000
Disable address space layout randomization

macroP_WEXIT

#define P_WEXIT 0x00002000
Working on exiting

macroP_EXEC

#define P_EXEC 0x00004000
Process called exec.

macroP_OWEUPC

Should be moved to machine-dependent areas.
#define P_OWEUPC 0x00008000
Owe process an addupc() call at next ast.

macroP_AFFINITY

#define P_AFFINITY 0x00010000
xxx

macroP_TRANSLATED

#define P_TRANSLATED 0x00020000
xxx

macroP_CLASSIC

#define P_CLASSIC P_TRANSLATED
xxx

macroP_DELAYIDLESLEEP

#define P_DELAYIDLESLEEP 0x00040000
Process is marked to delay idle sleep on disk IO

macroP_CHECKOPENEVT

#define P_CHECKOPENEVT 0x00080000
check if a vnode has the OPENEVT flag set on open

macroP_DEPENDENCY_CAPABLE

#define P_DEPENDENCY_CAPABLE 0x00100000
process is ok to call vfs_markdependency()

macroP_REBOOT

#define P_REBOOT 0x00200000
Process called reboot()

macroP_RESV6

#define P_RESV6 0x00400000
used to be P_TBE

macroP_RESV7

#define P_RESV7 0x00800000
(P_SIGEXC)signal exceptions

macroP_THCWD

#define P_THCWD 0x01000000
process has thread cwd

macroP_RESV9

#define P_RESV9 0x02000000
(P_VFORK)process has vfork children

macroP_ADOPTPERSONA

#define P_ADOPTPERSONA 0x04000000
process adopted a persona (used to be P_NOATTACH)

macroP_RESV11

#define P_RESV11 0x08000000
(P_INVFORK) proc in vfork

macroP_NOSHLIB

#define P_NOSHLIB 0x10000000
no shared libs are in use for proc

macroP_FORCEQUOTA

flag set on exec
#define P_FORCEQUOTA 0x20000000
Force quota for root

macroP_NOCLDWAIT

#define P_NOCLDWAIT 0x40000000
No zombies when chil procs exit

macroP_NOREMOTEHANG

#define P_NOREMOTEHANG 0x80000000
Don't hang on remote FS ops

macroP_INMEM

#define P_INMEM 0
Obsolete: retained for compilation

macroP_NOSWAP

#define P_NOSWAP 0
Obsolete: retained for compilation

macroP_PHYSIO

#define P_PHYSIO 0
Obsolete: retained for compilation

macroP_FSTRACE

#define P_FSTRACE 0
Obsolete: retained for compilation

macroP_SSTEP

#define P_SSTEP 0
Obsolete: retained for compilation

macroP_DIRTY_TRACK

#define P_DIRTY_TRACK 0x00000001
track dirty state

macroP_DIRTY_ALLOW_IDLE_EXIT

#define P_DIRTY_ALLOW_IDLE_EXIT 0x00000002
process can be idle-exited when clean

macroP_DIRTY_DEFER

#define P_DIRTY_DEFER 0x00000004
defer initial opt-in to idle-exit

macroP_DIRTY

#define P_DIRTY 0x00000008
process is dirty

macroP_DIRTY_SHUTDOWN

#define P_DIRTY_SHUTDOWN 0x00000010
process is dirty during shutdown

macroP_DIRTY_TERMINATED

#define P_DIRTY_TERMINATED 0x00000020
process has been marked for termination

macroP_DIRTY_BUSY

#define P_DIRTY_BUSY 0x00000040
serialization flag

macroP_DIRTY_MARKED

#define P_DIRTY_MARKED 0x00000080
marked dirty previously

macroP_DIRTY_AGING_IN_PROGRESS

#define P_DIRTY_AGING_IN_PROGRESS 0x00000100
aging in one of the 'aging bands'

macroP_DIRTY_LAUNCH_IN_PROGRESS

#define P_DIRTY_LAUNCH_IN_PROGRESS 0x00000200
launch is in progress

macroP_DIRTY_DEFER_ALWAYS

#define P_DIRTY_DEFER_ALWAYS 0x00000400
defer going to idle-exit after every dirty->clean transition. For legacy jetsam policy only. This is the default with the other policies.

macroP_DIRTY_SHUTDOWN_ON_CLEAN

#define P_DIRTY_SHUTDOWN_ON_CLEAN 0x00000800
process should shutdown on going clean

macroP_DIRTY_IM_NEW_HERE

#define P_DIRTY_IM_NEW_HERE 0x00001000
process just enrolled in dirty tracking and has not yet marked itself dirty for the first time

macroP_DIRTY_IS_DIRTY

#define P_DIRTY_IS_DIRTY (P_DIRTY | P_DIRTY_SHUTDOWN)

macroP_DIRTY_IDLE_EXIT_ENABLED

#define P_DIRTY_IDLE_EXIT_ENABLED (P_DIRTY_TRACK|P_DIRTY_ALLOW_IDLE_EXIT)