Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Pzonepath (3PROC)

Name

Pexecname, Pbrandname, Pzonename, Pzoneroot, Pplatform, Pobjname, Pzonepath, Puname - get process names

Synopsis

#include <libproc.h>
char *Pexecname(ps_prochandle_t *Pr, char *buf, size_t bufsize);
char *Pbrandname(ps_prochandle_t *Pr, char *buf, size_t bufsize);
char *Pzonename(ps_prochandle_t *Pr, char *buf, size_t bufsize);
char *Pzoneroot(ps_prochandle_t *Pr, char *buf, size_t bufsize);
char *Pplatform(ps_prochandle_t *Pr, char *buf, size_t bufsize);
char *Pobjname(ps_prochandle_t *Pr, uintptr_t addr,
         char *buf, size_t bufsize);
char *Pzonepath(ps_prochandle_t *Pr, const char *path,
         char *buf, size_t bufsize);
int Puname(ps_prochandle_t *Pr, struct utsname *buf);

Description

The Pr argument identifies a victim process or core file attached to the controlling process by the create and grab interfaces. For more information, see the Pcreate(3PROC) and Pgrab(3PROC) man pages.

For each of these functions except the Puname() function, the result of a successful call to the function is placed in the buffer specified by the buf argument, and the function returns the buf argument. On failure, the function returns NULL. The size of the caller's buffer is bufsize bytes. On successful return, the buffer will be NULL terminated and the result will be truncated if the buffer is too small.

The Pexecname() function retrieves the executable file name of the victim process, and if possible, a full path name.

The Pbrandname() function retrieves the brand name of the victim process.

The Pzonename() function retrieves the zone name of the victim process.

The Pzoneroot() function retrieves the zone root of the victim process, and if possible, a full path name.

The Pplatform() function retrieves the name of the platform on which the victim process is or was running.

The Pobjname() function retrieves the name of the underlying mapped object corresponding to the virtual address addr in the victim process, and if possible, a full path name.

The Pzonepath() function retrieves the full path name of the object specified by the path argument within a zone.

The Puname() function retrieves the utsname information for the victim process or core file. This is the same as uname(buf) for a live process, but the data is extracted from a core file. The Puname() function returns 0 on success and -1 on failure.

Return Values

All of these functions except the Puname() function return NULL on failure. The Puname() function returns -1 on failure.

Errors

On failure, these errno values may be set:

EAGAIN

Process has been lost to control, needs the Preopen() function

EINVAL

Invalid argument

ENODATA

Pr does not refer to a live process or core file

ENOENT

No such lwp

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Unsafe

See Also

libproc.h(3HEAD), libproc(3LIB), Pcreate(3PROC), Pgrab(3PROC), proc(5)