Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man3proc/Psyscall.3proc
Real path: /usr/share/man/man3proc/Psyscall.3proc
Zurück
'\" te .\" Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. .TH Psyscall 3PROC "7 Mar 2016" "Oracle Solaris 11.4" "Process Control Library Functions" .SH NAME Psyscall \- execute a system call trap in the victim process .SH SYNOPSIS .LP .nf #include <sys/syscall.h> #include <libproc.h> .fi .LP .nf int Psyscall(ps_prochandle_t *Pr, sysret_t *rval, int systrap, uint_t nargs, argdes_t *argp); .fi .SH DESCRIPTION .sp .LP The \fBPsyscall()\fR function forces a victim process to execute a system call trap on behalf of the controlling process. .sp .LP The \fBPr\fR argument identifies a live 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 \fBsystrap\fR argument identifies the system call trap number to be executed by the victim process. It must be one of the \fBSYS_*\fR values defined in the \fB<sys/syscall.h>\fR header file. .sp .LP The \fBnargs\fR argument is the count of system call trap arguments to be passed to the victim process. The \fBargp\fR argument is an array of \fBnargs argdes_t\fR structures, each describing the system call argument to be passed to the victim process: .sp .in +2 .nf typedef struct { long arg_value; /* value of argument given to system call */ void *arg_object; /* pointer to object in controlling process */ char arg_type; /* AT_BYVAL, AT_BYREF */ char arg_inout; /* AI_INPUT, AI_OUTPUT, AI_INOUT */ ushort_t arg_size; /* if AT_BYREF, size of object in bytes */ } argdes_t; .fi .in -2 .sp .sp .LP If \fBarg_type\fR is \fBAT_BYVAL\fR, the argument value must be contained in \fBarg_value\fR and no other members have any meaning. .sp .LP If \fBarg_type\fR is \fBAT_BYREF\fR, then \fBarg_value\fR has no meaning but \fBarg_object\fR must point to an object of \fBsize arg_size\fR in the controlling process and \fBarg_inout\fR has the following meanings: .sp .ne 2 .mk .na \fBAI_INPUT\fR .ad .RS 13n .rt The object will be copied to the victim process before execution of the system call trap. .RE .sp .ne 2 .mk .na \fBAI_OUTPUT\fR .ad .RS 13n .rt The object will be copied back to the controlling process after the system call trap is executed. .RE .sp .ne 2 .mk .na \fBAI_INOUT\fR .ad .RS 13n .rt Both of the above actions will occur. .RE .sp .LP The maximum number of arguments or \fBMAXARGS\fR is 8. The maximum size of a \fBBYREF\fR object or \fBMAXARGL\fR is 8 Kilobytes. .sp .LP On successful completion, the \fBPsyscall()\fR function returns the \fBerrno\fR value produced by the system call trap in the victim process. If this value is zero, then one or two return values from the successful system call trap in the victim process are returned in the \fBrval\fR argument, whose \fBtype\fR is defined in \fB<sys/syscall.h>\fR: .sp .in +2 .nf typedef struct { long sys_rval1; /* primary return value from system call */ long sys_rval2; /* second return value from system call */ } sysret_t; .fi .in -2 .sp .SH RETURN VALUES .sp .LP On failure to cause execution of the system call trap in the victim process, the \fBPsyscall()\fR function returns \fB-1\fR and sets the \fBerrno\fR of the controlling process to indicate the error. .SH NOTES .sp .LP The \fBPsyscall()\fR function uses the \fB/proc\fR agent \fBlwp\fR in the victim process to perform the actual system call trap, creating it if necessary. This means that all of the \fBlwps\fR in the victim process are stopped and restarted for each call to the \fBPsyscall()\fR function, unless the calls are bracketed by calls to the \fBPcreate_agent()\fR and \fBPdestroy_agent()\fR functions, in which case the stopping and restarting happens just once, not on every embedded call to the \fBPsyscall()\fR function. For more information, see the \fBPcreate_agent\fR(3PROC) man page. .sp .LP To make things complicated, the system call trap table is not a public interface. Details of the trap table interfaces can change on any update of the operating system, even in a system patch, not just on system release boundaries. The \fBlibproc\fR library includes many pre-defined victim process system call interfaces which will be updated as needed on any release that requires it. See what you can find in \fBpr_access\fR(3PROC) before creating another one. .SH ERRORS .sp .LP On failure, these \fBerrno\fR values may be set: .sp .ne 2 .mk .na \fB\fBEAGAIN\fR\fR .ad .RS 10n .rt Process has been lost to control, needs the \fBPreopen()\fR function .RE .sp .ne 2 .mk .na \fB\fBEINTR\fR\fR .ad .RS 10n .rt Signal received while waiting for stop .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt Invalid argument .RE .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 10n .rt The victim process has terminated .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 \fBgelf\fR(3ELF), \fBlibproc.h\fR(3HEAD), \fBlibproc\fR(3LIB), \fBPcreate\fR(3PROC), \fBPgrab\fR(3PROC), \fBPcreate_agent\fR(3PROC), \fBproc\fR(5)