PSETRUN(3PROC) | Process Control Library Functions | PSETRUN(3PROC) |
Psetrun
, Lsetrun
— run a stopped process or thread
Process Control Library (libproc, -lproc)
#include
<libproc.h>
int
Psetrun
(struct ps_prochandle *P,
int sig, int flags);
int
Lsetrun
(struct ps_lwphandle *L,
int sig, int flags);
The
Psetrun
()
function resumes the stopped process handle P and
transitions the process to running. If sig is
non-zero, then the Psetrun
() function causes the
signal to be delivered. See
signal.h(3HEAD) for a list of
valid signal identifiers.
The flags member modifies the behavior of the resumed handle. The following values may be combined by a bitwise-inclusive-OR:
PRCSIG
PRCFAULT
PRSTEP
PRSABORT
EINTR
.If both PRCSIG
is specified and
sig is non-zero, then the
PRCSIG
request takes priority, and it will be
treated as though sig was passed the argument
0.
When the process is resumed all extent tracing flags and register changes will be synchronized with the process. For more information on resuming a thread see the PCRUN section in proc(5).
Note, the
Psetrun
()
function is only valid for active processes. It will fail on process handles
that refer to core files, zombie processes, and ELF objects.
The
Lsetrun
()
function is equivalent to the Psetrun
() function,
except rather than operating on a process it operates on a thread.
Lsetrun
() causes the specified thread,
L, to resume execution. Whereas
Psetrun
() causes all threads in the process to
resume.
Upon successful completion, the Psetrun
()
and Lsetrun
() functions return 0.
Otherwise, -1 is
returned and
errno is
set to indicate the error.
For a full list of possible errors see the DIAGNOSTICS section in proc(5).
The Psetrun
() and
Lsetrun
() functions will fail if:
EBUSY
See LOCKING in libproc(3LIB).
May 11, 2016 | OmniOS |