Debian Codegraph @

upstream/debian-unstable/man2/PR_GET_SECCOMP.2

raw
1 .\" Copyright 2008-2015, Michael Kerrisk <[email protected]>
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH PR_GET_SECCOMP 2 2026-02-08 "Linux man-pages 6.18"
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,
25 this operation returns 0;
26 if the caller is in strict secure computing mode,
27 then the
28 .BR prctl ()
29 call will cause a
30 .B SIGKILL
31 signal to be sent to the process.
32 If the caller is in filter mode,
33 and this system call is allowed by the seccomp filters,
34 it returns 2;
35 otherwise,
36 the process is killed with a
37 .B SIGKILL
38 signal.
39 .P
40 This operation is available only
41 if the kernel is configured with
42 .B CONFIG_SECCOMP
43 enabled.
44 .SH RETURN VALUE
45 On success,
46 this call
47 returns the nonnegative value described above.
48 On error, \-1 is returned, and
49 .I errno
50 is set to indicate the error;
51 or the process is killed.
52 .SH ERRORS
53 .TP
54 .B EINVAL
55 The kernel was not configured with
56 .BR CONFIG_SECCOMP .
57 .TP
58 .B SIGKILL
59 The caller is in strict secure computing mode.
60 .TP
61 .B SIGKILL
62 The caller is in filter mode,
63 and this system call is not allowed by the seccomp filters.
64 .SH FILES
65 .TP
66 .IR /proc/ pid /status
67 Since Linux 3.8, the
68 .I Seccomp
69 field of this file
70 provides a method of obtaining the same information,
71 without the risk that the process is killed;
72 see
73 .BR proc_pid_status (5).
74 .SH STANDARDS
75 Linux.
76 .SH HISTORY
77 Linux 2.6.23.
78 .SH SEE ALSO
79 .BR prctl (2),
80 .BR PR_SET_SECCOMP (2const),
81 .BR seccomp (2)