xref: /illumos-gate/usr/src/man/man3proc/Pcreate_agent.3proc (revision 72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2)
143051d27SRobert Mustacchi.\"
243051d27SRobert Mustacchi.\" This file and its contents are supplied under the terms of the
343051d27SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0.
443051d27SRobert Mustacchi.\" You may only use this file in accordance with the terms of version
543051d27SRobert Mustacchi.\" 1.0 of the CDDL.
643051d27SRobert Mustacchi.\"
743051d27SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this
843051d27SRobert Mustacchi.\" source.  A copy of the CDDL is also available via the Internet at
943051d27SRobert Mustacchi.\" http://www.illumos.org/license/CDDL.
1043051d27SRobert Mustacchi.\"
1143051d27SRobert Mustacchi.\"
1243051d27SRobert Mustacchi.\" Copyright 2015 Joyent, Inc.
1343051d27SRobert Mustacchi.\"
1443051d27SRobert Mustacchi.Dd May 11, 2016
1543051d27SRobert Mustacchi.Dt PCREATE_AGENT 3PROC
1643051d27SRobert Mustacchi.Os
1743051d27SRobert Mustacchi.Sh NAME
1843051d27SRobert Mustacchi.Nm Pcreate_agent
1943051d27SRobert Mustacchi.Nd create the agent LWP
2043051d27SRobert Mustacchi.Sh SYNOPSIS
2143051d27SRobert Mustacchi.Lb libproc
2243051d27SRobert Mustacchi.In libproc.h
2343051d27SRobert Mustacchi.Ft int
2443051d27SRobert Mustacchi.Fo Pcreate_agent
2543051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
2643051d27SRobert Mustacchi.Fc
2743051d27SRobert Mustacchi.Sh DESCRIPTION
2843051d27SRobert MustacchiThe
2943051d27SRobert Mustacchi.Fn Pcreate_agent
3043051d27SRobert Mustacchifunction creates the agent LWP in the process represented by the handle
3143051d27SRobert Mustacchi.Fa P .
3243051d27SRobert MustacchiThe agent LWP is used as a means to force system calls to be invoked on
33*72d3dbb9SYuri Pankovthe controlled process.
34*72d3dbb9SYuri PankovFor more information on the agent LWP, see
3543051d27SRobert Mustacchi.Xr proc 4 .
3643051d27SRobert Mustacchi.Pp
3743051d27SRobert MustacchiThe agent LWP cannot be created for process handles corresponding to
3843051d27SRobert Mustacchicore files, zombie processes, processes that have yet to run, and ELF
3943051d27SRobert Mustacchiobjects.
4043051d27SRobert Mustacchi.Pp
4143051d27SRobert MustacchiThe
4243051d27SRobert Mustacchi.Fn Pcreate_agent
43*72d3dbb9SYuri Pankovfunction is reentrant.
44*72d3dbb9SYuri PankovIt may be entered recursively.
45*72d3dbb9SYuri PankovThe act of creating the agent LWP will cause the process to be stopped.
4643051d27SRobert MustacchiFor every call to the
4743051d27SRobert Mustacchi.Fn Pcreate_agent
4843051d27SRobert Mustacchifunction, a corresponding call to
4943051d27SRobert Mustacchi.Xr Pdestroy_agent 3PROC
5043051d27SRobert Mustacchiis required.
5143051d27SRobert Mustacchi.Sh RETURN VALUES
5243051d27SRobert MustacchiUpon successful completion, the
5343051d27SRobert Mustacchi.Fn Pcreate_agent
5443051d27SRobert Mustacchifunction returns
5543051d27SRobert Mustacchi.Sy 0
56*72d3dbb9SYuri Pankovand creates the agent LWP.
57*72d3dbb9SYuri PankovOtherwise,
5843051d27SRobert Mustacchi.Sy -1
5943051d27SRobert Mustacchiis returned,
6043051d27SRobert Mustacchi.Sy errno
6143051d27SRobert Mustacchiis set to indicate the error, and the agent LWP is not created.
6243051d27SRobert Mustacchi.Sh ERRORS
6343051d27SRobert MustacchiThe
6443051d27SRobert Mustacchi.Fn Pcreate_agent
6543051d27SRobert Mustacchifunction will fail if:
6643051d27SRobert Mustacchi.Bl -tag -width Er
6743051d27SRobert Mustacchi.It Er ENOENT
6843051d27SRobert MustacchiThe process referred to by
6943051d27SRobert Mustacchi.Fa P
7043051d27SRobert Mustacchiis a core file, zombie, ELF object, or has not begun execution.
7143051d27SRobert Mustacchi.El
7243051d27SRobert Mustacchi.Pp
73*72d3dbb9SYuri PankovNote, it is possible for other error numbers to be returned.
74*72d3dbb9SYuri PankovIf they are, they represent unanticipated failure.
7543051d27SRobert Mustacchi.Sh INTERFACE STABILITY
7643051d27SRobert Mustacchi.Sy Uncommitted
7743051d27SRobert Mustacchi.Sh MT-LEVEL
7843051d27SRobert MustacchiSee
7943051d27SRobert Mustacchi.Sy LOCKING
8043051d27SRobert Mustacchiin
8143051d27SRobert Mustacchi.Xr libproc 3LIB .
8243051d27SRobert Mustacchi.Sh SEE ALSO
8343051d27SRobert Mustacchi.Xr libproc 3LIB ,
8443051d27SRobert Mustacchi.Xr Pdestroy_agent 3PROC ,
8543051d27SRobert Mustacchi.Xr proc 4
86