|
|
#include <sys/types.h> #include <sys/proc.h>short p_pgrp; /* process group */ short p_pid; /* process ID */ pid_t p_sid; /* POSIX session ID number */
This structure contains information about a process and its
state in the kernel. Even though many fields exist, only
p_pgrp, p_pid,
and p_sid
fields can be used in a device
driver. All fields in the proc structure are for
reading only; do not write to any field in this structure.
The process table can only be read in the
task-time section of a device driver; that is, when a
driver has user context.
The p_sid
field is related to the p_pgrp
field
in its use and value. In most cases, these fields have the
same value, but under special circumstances determined by a
driver's implementation, they can differ.
If the p_pgrp
and the p_pid
fields contain the
same value, then the process is the process group leader.
The u.u_procp
field in the user structure
contains a pointer to the proc structure.
The setpgrp(S-osr5) and setsid(S-osr5) system calls provide direct writing capability to the proc structure. These are the only means that should be used to write to this structure.