xref: /illumos-gate/usr/src/man/man3proc/pr_gettaskid.3proc (revision cd61ae21816e53b94bc1673f3f1aa651fc3115e8)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2015 Joyent, Inc.
13.\"
14.Dd May 11, 2016
15.Dt PR_GETTASKID 3PROC
16.Os
17.Sh NAME
18.Nm pr_gettaskid
19.Nd inject gettaskid system call into victim process
20.Sh SYNOPSIS
21.Lb libproc
22.In libproc.h
23.Ft taskid_t
24.Fo pr_gettaskid
25.Fa "struct ps_prochandle *P"
26.Fc
27.Sh DESCRIPTION
28The
29.Fn pr_gettaskid
30function injects the
31.Xr gettaskid 2
32system call into the target process
33.Fa P
34by means of the agent LWP.
35If the process handle
36.Fa P
37is the value
38.Dv NULL
39then this will be equivalent to calling
40.Xr gettaskid 2
41on the currently running process.
42.Pp
43The
44.Fn pr_gettaskid
45function only works on active processes.
46Process handles that correspond to core files, zombie processes, or ELF objects
47do not support system call injection.
48.Sh RETURN VALUES
49Upon successful completion, the
50.Fn pr_gettaskid
51function's return value is that described in
52.Xr gettaskid 2 .
53Otherwise,
54.Sy -1
55is returned and
56.Sy errno
57is set to
58.Er ENOSYS
59to indicate that the system call could not be injected.
60.Sh ERRORS
61For the full list of errors see the
62.Sy ERRORS
63section in
64.Xr gettaskid 2 .
65.Pp
66The
67.Fn pr_gettaskid
68function will fail if:
69.Bl -tag -width Er
70.It Er ENOSYS
71An error occurred while trying to invoke the agent LWP and inject a
72system call in the process handle
73.Fa P
74or the process handle
75.Fa P
76does not support system call injection.
77.El
78.Sh INTERFACE STABILITY
79.Sy Uncommitted
80.Sh MT-LEVEL
81See
82.Sy LOCKING
83in
84.Xr libproc 3LIB .
85.Sh SEE ALSO
86.Xr gettaskid 2 ,
87.Xr libproc 3LIB ,
88.Xr proc 4
89