PCTFLD(3PROC) Process Control Library Functions PCTFLD(3PROC)

NAME


Pctlfd - obtain the process control file descriptor

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

int
Pctlfd(struct ps_prochandle *P);

DESCRIPTION


The Pctlfd() function returns a file descriptor to the underlying /proc
file system ctl file for the process identified by the handle P. This may
be used for injecting control operations manually; however, many interfaces
for using it are provided by libproc(3LIB) itself.

Only live processes have a control file descriptor. Process handles that
correspond to files and cores, created through Pgrab_file(3PROC) and
Pgrab_core(3PROC), do not have a corresponding file descriptor.

The file descriptor is invalidated when the process handle is released
through Prelease(3PROC) or if control is lost and the handle is reopened.

RETURN VALUES


Upon successful completion, the Pctlfd() function returns a valid file
descriptor. Otherwise, if none exists, then -1 is returned.

INTERFACE STABILITY


Uncommitted

MT-LEVEL
See LOCKING in libproc(3LIB).

SEE ALSO


libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC),
Pgrab_file(3PROC), Prelease(3PROC), Preopen(3PROC), proc(5)

illumos May 11, 2016 illumos