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

Pasfd
obtain the process address space file descriptor

Process Control Library (libproc, -lproc)

#include <libproc.h>
int
Pasfd(struct ps_prochandle *P);

The Pasfd() funtion returns a file descriptor that allows direct access to the address space of the process handle P. A defined file descriptor is provided when using the Pcreate(3PROC), Pgrab(3PROC), Pgrab_file(3PROC), and Pgrab_core(3PROC) functions. Note that the address space may be different in each of these cases and doesn't necessarily correspond to the /proc as file, except for live processes. Other means of obtaining a libproc process handle may not define a file descriptor that contains the address space.
The returned file descriptor must not be closed and is only valid for as long as the corresponding process handle P is valid. After a call to Prelease(3PROC) the file descriptor is invalidated.

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

Uncommitted

See LOCKING in libproc(3LIB).

libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), Pgrab_core(3PROC), Pgrab_file(3PROC), Prelease(3PROC), proc(4)
May 11, 2016 illumos