Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Plwp_stack (3PROC)

Name

Plwp_stack, Plwp_alt_stack, Plwp_main_stack - retrieve stack information for a victim process

Synopsis

#include <libproc.h>
int Plwp_stack(ps_prochandle_t *Pr, lwpid_t lwpid, stack_t *stkp);
int Plwp_alt_stack(ps_prochandle_t *Pr, lwpid_t lwpid, stack_t *stkp);
int Plwp_main_stack(ps_prochandle_t *Pr, lwpid_t lwpid, stack_t *stkp);

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. The lwpid argument identifies one of the lwps in the victim process, and the stkp argument identifies the result buffer.

The Plwp_stack() function returns the current stack information for the specified lwp in the stkp argument.

The Plwp_alt_stack() function returns the alternate stack information for the specified lwp in the stkp argument, whether or not it is currently executing on that stack.

The Plwp_main_stack() function returns the primary stack information for the specified lwp in the stkp argument, whether or not it is currently executing on that stack.

Return Values

On successful completion, all of these functions return 0. On error, they return -1 and set errno to indicate the error.

Errors

On failure, these errno values may be set:

EAGAIN

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

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)