|LGRAB(3PROC)||Process Control Library Functions||LGRAB(3PROC)|
Lgrab — obtain a
handle to control a thread
Process Control Library (libproc, -lproc)
struct ps_lwphandle *
Lgrab(struct ps_prochandle *P,
lwpid_t lwpid, int *perr);
function obtains a control handle to the thread identified by
lwpid residing under the process
P. This handle is then passed as argument to other
routines. The lwpid can be obtained from the
member of the
The perr argument must point to
a valid pointer that will be used to store an error code in the event that
unable to successfully obtain a handle to the process. The possible errors
are defined below in the ERRORS section.
The code may be transformed into a human readable string through the use of
The handle to the thread is valid until the
Lfree(3PROC) function is called,
which also releases associated resources from the handle. Only a single
handle to a specific thread may exist at any time. If the handle already
exists and another caller attempts to grab that thread, it will result in an
error. The caller must call
before releasing the handle associated with P.
Unlike grabbing a process, grabbing a thread does not change the current state of the thread. If it is running, it will remain running. If it is stopped, it will remain stopped.
Upon successful completion, the
function returns a pointer to the control handle for the specified thread.
NULL pointer is returned and
perr is set to indicate the error.
Lgrab() function will fail if:
|May 11, 2016||OmniOS|