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

NAME


Pexecname - obtain full path to process executable

LIBRARY


Process Control Library (libproc, -lproc)

SYNOPSIS


#include <libproc.h>

char *
Pexecname(struct ps_prochandle *P, char *buf, size_t buflen);

DESCRIPTION


The Pexecname() function attempts to determine the full path to the process
executable referred to by the handle P.

If found, buf will be filled in with the full path for up to buflen bytes,
including the null terminator.

For a handle grabbed with Pgrab_file(3PROC), the executable refers to the
path of the file itself. For a core file, the system attempts to determine
the original path of the executable and return that.

RETURN VALUES


Upon successful completion, the Pexecname() function returns the value of
buf, and up to buflen bytes of buf are filled in with a null-terminated
path. Otherwise, NULL is returned.

INTERFACE STABILITY


Uncommitted

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

SEE ALSO


libproc(3LIB)

illumos May 11, 2016 illumos