xref: /illumos-gate/usr/src/man/man3proc/Pcreate_agent.3proc (revision bbf215553c7233fbab8a0afdf1fac74c44781867)
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
20ab618543SJohn Levon.Sh LIBRARY
2143051d27SRobert Mustacchi.Lb libproc
22ab618543SJohn Levon.Sh SYNOPSIS
2343051d27SRobert Mustacchi.In libproc.h
2443051d27SRobert Mustacchi.Ft int
2543051d27SRobert Mustacchi.Fo Pcreate_agent
2643051d27SRobert Mustacchi.Fa "struct ps_prochandle *P"
2743051d27SRobert Mustacchi.Fc
2843051d27SRobert Mustacchi.Sh DESCRIPTION
2943051d27SRobert MustacchiThe
3043051d27SRobert Mustacchi.Fn Pcreate_agent
3143051d27SRobert Mustacchifunction creates the agent LWP in the process represented by the handle
3243051d27SRobert Mustacchi.Fa P .
3343051d27SRobert MustacchiThe agent LWP is used as a means to force system calls to be invoked on
3472d3dbb9SYuri Pankovthe controlled process.
3572d3dbb9SYuri PankovFor more information on the agent LWP, see
36*bbf21555SRichard Lowe.Xr proc 5 .
3743051d27SRobert Mustacchi.Pp
3843051d27SRobert MustacchiThe agent LWP cannot be created for process handles corresponding to
3943051d27SRobert Mustacchicore files, zombie processes, processes that have yet to run, and ELF
4043051d27SRobert Mustacchiobjects.
4143051d27SRobert Mustacchi.Pp
4243051d27SRobert MustacchiThe
4343051d27SRobert Mustacchi.Fn Pcreate_agent
4472d3dbb9SYuri Pankovfunction is reentrant.
4572d3dbb9SYuri PankovIt may be entered recursively.
4672d3dbb9SYuri PankovThe act of creating the agent LWP will cause the process to be stopped.
4743051d27SRobert MustacchiFor every call to the
4843051d27SRobert Mustacchi.Fn Pcreate_agent
4943051d27SRobert Mustacchifunction, a corresponding call to
5043051d27SRobert Mustacchi.Xr Pdestroy_agent 3PROC
5143051d27SRobert Mustacchiis required.
5243051d27SRobert Mustacchi.Sh RETURN VALUES
5343051d27SRobert MustacchiUpon successful completion, the
5443051d27SRobert Mustacchi.Fn Pcreate_agent
5543051d27SRobert Mustacchifunction returns
5643051d27SRobert Mustacchi.Sy 0
5772d3dbb9SYuri Pankovand creates the agent LWP.
5872d3dbb9SYuri PankovOtherwise,
5943051d27SRobert Mustacchi.Sy -1
6043051d27SRobert Mustacchiis returned,
6143051d27SRobert Mustacchi.Sy errno
6243051d27SRobert Mustacchiis set to indicate the error, and the agent LWP is not created.
6343051d27SRobert Mustacchi.Sh ERRORS
6443051d27SRobert MustacchiThe
6543051d27SRobert Mustacchi.Fn Pcreate_agent
6643051d27SRobert Mustacchifunction will fail if:
6743051d27SRobert Mustacchi.Bl -tag -width Er
6843051d27SRobert Mustacchi.It Er ENOENT
6943051d27SRobert MustacchiThe process referred to by
7043051d27SRobert Mustacchi.Fa P
7143051d27SRobert Mustacchiis a core file, zombie, ELF object, or has not begun execution.
7243051d27SRobert Mustacchi.El
7343051d27SRobert Mustacchi.Pp
7472d3dbb9SYuri PankovNote, it is possible for other error numbers to be returned.
7572d3dbb9SYuri PankovIf they are, they represent unanticipated failure.
7643051d27SRobert Mustacchi.Sh INTERFACE STABILITY
7743051d27SRobert Mustacchi.Sy Uncommitted
7843051d27SRobert Mustacchi.Sh MT-LEVEL
7943051d27SRobert MustacchiSee
8043051d27SRobert Mustacchi.Sy LOCKING
8143051d27SRobert Mustacchiin
8243051d27SRobert Mustacchi.Xr libproc 3LIB .
8343051d27SRobert Mustacchi.Sh SEE ALSO
8443051d27SRobert Mustacchi.Xr libproc 3LIB ,
8543051d27SRobert Mustacchi.Xr Pdestroy_agent 3PROC ,
86*bbf21555SRichard Lowe.Xr proc 5
87