Debian Codegraph @

upstream/debian-trixie/man2/PR_GET_SECCOMP.2

raw
1 .\" Copyright 2008, 2012, 2013, 2015, Michael Kerrisk <[email protected]>
2 .\" Copyright 2024, Alejandro Colomar <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH PR_GET_SECCOMP 2 2024-06-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 PR_GET_SECCOMP
9 \-
10 get the secure computing mode
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ", " \-lc )
14 .SH SYNOPSIS
15 .nf
16 .BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
17 .B #include <sys/prctl.h>
18 .P
19 .B int prctl(PR_GET_SECCOMP);
20 .fi
21 .SH DESCRIPTION
22 Return the secure computing mode of the calling thread.
23 .P
24 If the caller is not in secure computing mode, this operation returns 0;
25 if the caller is in strict secure computing mode, then the
26 .BR prctl ()
27 call will cause a
28 .B SIGKILL
29 signal to be sent to the process.
30 If the caller is in filter mode, and this system call is allowed by the
31 seccomp filters, it returns 2; otherwise, the process is killed with a
32 .B SIGKILL
33 signal.
34 .P
35 This operation is available only
36 if the kernel is configured with
37 .B CONFIG_SECCOMP
38 enabled.
39 .SH RETURN VALUE
40 On success,
41 this call
42 returns the nonnegative value described above.
43 On error, \-1 is returned, and
44 .I errno
45 is set to indicate the error;
46 or the process is killed.
47 .SH ERRORS
48 .TP
49 .B EINVAL
50 The kernel was not configured with
51 .BR CONFIG_SECCOMP .
52 .TP
53 .B SIGKILL
54 The caller is in strict secure computing mode.
55 .TP
56 .B SIGKILL
57 The caller is in filter mode,
58 and this system call is not allowed by the seccomp filters.
59 .SH FILES
60 .TP
61 .IR /proc/ pid /status
62 Since Linux 3.8, the
63 .I Seccomp
64 field of this file
65 provides a method of obtaining the same information,
66 without the risk that the process is killed; see
67 .BR proc_pid_status (5).
68 .SH STANDARDS
69 Linux.
70 .SH HISTORY
71 Linux 2.6.23.
72 .SH SEE ALSO
73 .BR prctl (2),
74 .BR PR_SET_SECCOMP (2const),
75 .BR seccomp (2)