xref: /illumos-gate/usr/src/man/man3proc/pr_gettaskid.3proc (revision a7d7cafedfa26f9e421bbcaf42b7387ef67c0a31)
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 November 27, 2023
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 LIBRARY
21.Lb libproc
22.Sh SYNOPSIS
23.In libproc.h
24.Ft taskid_t
25.Fo pr_gettaskid
26.Fa "struct ps_prochandle *P"
27.Fc
28.Sh DESCRIPTION
29The
30.Fn pr_gettaskid
31function injects the
32.Xr gettaskid 2
33system call into the target process
34.Fa P
35by means of the agent LWP.
36If the process handle
37.Fa P
38is the value
39.Dv NULL
40then this will be equivalent to calling
41.Xr gettaskid 2
42on the currently running process.
43.Pp
44The
45.Fn pr_gettaskid
46function only works on active processes.
47Process handles that correspond to core files, zombie processes, or ELF objects
48do not support system call injection.
49.Sh RETURN VALUES
50Upon successful completion, the
51.Fn pr_gettaskid
52function's return value is that described in
53.Xr gettaskid 2 .
54Otherwise,
55.Sy -1
56is returned and
57.Sy errno
58is set to
59.Er ENOSYS
60to indicate that the system call could not be injected.
61.Sh ERRORS
62For the full list of errors see the
63.Sy ERRORS
64section in
65.Xr gettaskid 2 .
66.Pp
67The
68.Fn pr_gettaskid
69function will fail if:
70.Bl -tag -width Er
71.It Er ENOSYS
72An error occurred while trying to invoke the agent LWP and inject a
73system call in the process handle
74.Fa P
75or the process handle
76.Fa P
77does not support system call injection.
78.El
79.Sh INTERFACE STABILITY
80.Sy Uncommitted
81.Sh MT-LEVEL
82See
83.Sy LOCKING
84in
85.Xr libproc 3LIB .
86.Sh SEE ALSO
87.Xr gettaskid 2 ,
88.Xr libproc 3LIB ,
89.Xr proc 5
90