| PGET(9) | MidnightBSD Kernel Developer's Manual | PGET(9) |
pget — locate a
process by number
#include
<sys/param.h>
#include <sys/proc.h>
int
pget(pid_t
pid, int flags,
struct proc **pp);
This function takes a pid as its argument,
which can be either a process or thread id, and fills a pointer to the
proc structure in *pp. In the
latter case, a process owning the specified thread is looked for. The
operation is performed by invoking the
pfind(9) function. The
found process is returned locked. For the PGET_HOLD
case, it is returned unlocked (but held). The
pget()
function can perform additional manipulations, depending on a
flags argument.
The flags argument is the logical OR of some subset of:
PGET_HOLDPGET_CANSEEPGET_CANDEBUGPGET_ISCURRENTPGET_NOTWEXITP_WEXIT set.PGET_NOTINEXECP_INEXEC set.PGET_NOTIDPID_MAX.PGET_WANTREADPGET_HOLD | PGET_CANDEBUG
| PGET_NOTWEXIT).If the process is found in the specified way, then zero is returned, otherwise an appropriate error code is returned.
| May 3, 2014 | midnightbsd-4.0 |