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

Retrives the node number associated with the given Process ID from the BProc process space. Note only user processes ghosted on the master are available in this way. Node kernal and internal BProc PIDs are not accessable.

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

EACCESS

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.