1 PCTFLD(3PROC) Process Control Library Functions PCTFLD(3PROC) 2 3 NAME 4 Pctlfd - obtain the process control file descriptor 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Pctlfd(struct ps_prochandle *P); 14 15 DESCRIPTION 16 The Pctlfd() function returns a file descriptor to the underlying /proc 17 file system ctl file for the process identified by the handle P. This 18 may be used for injecting control operations manually; however, many 19 interfaces for using it are provided by libproc(3LIB) itself. 20 21 Only live processes have a control file descriptor. Process handles that 22 correspond to files and cores, created through Pgrab_file(3PROC) and 23 Pgrab_core(3PROC), do not have a corresponding file descriptor. 24 25 The file descriptor is invalidated when the process handle is released 26 through Prelease(3PROC) or if control is lost and the handle is reopened. 27 28 RETURN VALUES 29 Upon successful completion, the Pctlfd() function returns a valid file 30 descriptor. Otherwise, if none exists, then -1 is returned. 31 32 INTERFACE STABILITY 33 Uncommitted 34 35 MT-LEVEL 36 See LOCKING in libproc(3LIB). 37 38 SEE ALSO 39 libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC), 40 Pgrab_file(3PROC), Prelease(3PROC), Preopen(3PROC), proc(4) 41 42 illumos May 11, 2016 illumos