#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 */
p_sidfields 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.
p_sid field is related to the
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.
p_pgrp and the
p_pid fields contain the
same value, then the process is the process group leader.
u.u_procp field in the user structure
contains a pointer to the proc structure.
The setpgrp(S) and setsid(S) system calls provide direct writing capability to the proc structure. These are the only means that should be used to write to this structure.