bproc_pidnode¶
Name¶
bproc_pidnode – Get the node a PID is running on.
Synopsis¶
#include <sys/bproc.h>
int bproc_pidnode (int pid);
Arguments¶
pid
The process id
Description¶
Retrieves the node number associated with the given Process ID from the
BProc
process space. Note that only user processes ghosted on the
master are available in this way. Node kernel and internal BProc
PIDs are not accessible.
Return Value¶
Return the node number that the PID is running on.
Returns BPROC_NODE_NONE
if the PID is running on the master node or
isn’t a valid PID.
Bugs¶
This functions returns BPROC_NODE_NONE
if there was an error
accessing the BProc
status file, or if pid
was not found in the
status file. There is currently no way to tell if BPROC_NODE_NONE
resulted from an error or from pid
not being masqueraded by
BProc
.
Errors¶
- EACCES
The program does not have access to read the
BProc
status file.- ENOENT
The
BProc
status file does not exist.- ENOMEM
Insufficient kernel memory.
- EMFILE
The limit of files that can be opened by the process has been reached.
- ENFILE
The limit of files that can be opened by the system has been reached.
- EAGAIN
The
BProc
status file has been locked.