Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man3proc/Pcreate_agent.3proc
Real path: /usr/share/man/man3proc/Pcreate_agent.3proc
Zurück
'\" te .\" Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. .TH Pcreate_agent 3PROC "8 Mar 2016" "Oracle Solaris 11.4" "Process Control Library Functions" .SH NAME Pcreate_agent, Pdestroy_agent \- create and destroy the /proc agent lwp in the victim process .SH SYNOPSIS .LP .nf #include <libproc.h> .fi .LP .nf int Pcreate_agent(struct ps_prochandle *Pr); .fi .LP .nf void Pdestroy_agent(struct ps_prochandle *Pr); .fi .SH DESCRIPTION .sp .LP The \fBPr\fR argument identifies a victim process attached to the controlling process by the \fBcreate\fR and \fBgrab\fR interfaces. For more information, see the \fBPcreate\fR(3PROC) and \fBPgrab\fR(3PROC)) man pages. .sp .LP The \fBPcreate_agent()\fR function creates the \fB/proc\fR agent \fBlwp\fR if it does not exist. If the \fB/proc\fR agent \fBlwp\fR already exists, the \fBPcreate_agent()\fR function increments a reference count on it. For more information, see the \fBproc\fR(5) man page. .sp .LP The \fBPdestroy_agent()\fR function decrements the reference count on the \fB/proc\fR agent \fBlwp\fR, if it exists. If the reference count reaches zero, the agent \fBlwp\fR is destroyed. .sp .LP As a side-effect, the \fBPcreate_agent()\fR function causes the victim process to be stopped. The \fBPdestroy_agent()\fR function releases the victim process back to its original state when the reference count reaches zero and the agent \fBlwp\fR is destroyed. .SS "Motivation" .sp .LP The various \fBpr_*()\fR functions enable a controlling process to force a victim process to execute system calls on behalf of the controlling process. This is accomplished using the \fB/proc\fR agent \fBlwp\fR, which is created and destroyed on each call to one of the \fBpr_*()\fR functions. For more information, see the \fBpr_access\fR(3PROC) man page. .sp .LP If a controlling process wants to execute more than one system call in the victim process, then as an efficiency matter, it should create the \fB/proc\fR agent \fBlwp\fR just once, after grabbing and stopping the victim process and before it calls the several \fBpr_*()\fR functions it is interested in. It must call the \fBPdestroy_agent()\fR function before releasing the victim process. .SH RETURN VALUES .sp .LP On successful completion, the \fBPcreate_agent()\fR function returns \fB0\fR. On error, it returns \fB-1\fR and sets the \fBerrno\fR value to indicate the error. There is no return value from the \fBPdestroy_agent()\fR function. .SH ERRORS .sp .LP The \fBPcreate_agent()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 10n .rt The \fBPr\fR argument does not refer to a live process. It may be a zombie process or a core file. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level Unsafe .TE .sp .SH SEE ALSO .sp .LP \fBlibproc.h\fR(3HEAD), \fBlibproc\fR(3LIB), \fBPcreate\fR(3PROC), \fBPrelease\fR(3PROC), \fBPsyscall\fR(3PROC), \fBproc\fR(5)