summaryrefslogtreecommitdiff
path: root/usr/src/man/man3proc/Pcreate_agent.3proc
blob: e4617cd4c9d2b1bf2e129120a29ae7ceccafc696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.\"
.\" This file and its contents are supplied under the terms of the
.\" Common Development and Distribution License ("CDDL"), version 1.0.
.\" You may only use this file in accordance with the terms of version
.\" 1.0 of the CDDL.
.\"
.\" A full copy of the text of the CDDL should have accompanied this
.\" source.  A copy of the CDDL is also available via the Internet at
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
.\" Copyright 2015 Joyent, Inc.
.\"
.Dd May 11, 2016
.Dt PCREATE_AGENT 3PROC
.Os
.Sh NAME
.Nm Pcreate_agent
.Nd create the agent LWP
.Sh LIBRARY
.Lb libproc
.Sh SYNOPSIS
.In libproc.h
.Ft int
.Fo Pcreate_agent
.Fa "struct ps_prochandle *P"
.Fc
.Sh DESCRIPTION
The
.Fn Pcreate_agent
function creates the agent LWP in the process represented by the handle
.Fa P .
The agent LWP is used as a means to force system calls to be invoked on
the controlled process.
For more information on the agent LWP, see
.Xr proc 5 .
.Pp
The agent LWP cannot be created for process handles corresponding to
core files, zombie processes, processes that have yet to run, and ELF
objects.
.Pp
The
.Fn Pcreate_agent
function is reentrant.
It may be entered recursively.
The act of creating the agent LWP will cause the process to be stopped.
For every call to the
.Fn Pcreate_agent
function, a corresponding call to
.Xr Pdestroy_agent 3PROC
is required.
.Sh RETURN VALUES
Upon successful completion, the
.Fn Pcreate_agent
function returns
.Sy 0
and creates the agent LWP.
Otherwise,
.Sy -1
is returned,
.Sy errno
is set to indicate the error, and the agent LWP is not created.
.Sh ERRORS
The
.Fn Pcreate_agent
function will fail if:
.Bl -tag -width Er
.It Er ENOENT
The process referred to by
.Fa P
is a core file, zombie, ELF object, or has not begun execution.
.El
.Pp
Note, it is possible for other error numbers to be returned.
If they are, they represent unanticipated failure.
.Sh INTERFACE STABILITY
.Sy Uncommitted
.Sh MT-LEVEL
See
.Sy LOCKING
in
.Xr libproc 3LIB .
.Sh SEE ALSO
.Xr libproc 3LIB ,
.Xr Pdestroy_agent 3PROC ,
.Xr proc 5