Debian Codegraph @

upstream/debian-trixie/man2/PR_CAPBSET_DROP.2const

raw
1 .\" Copyright 2008, Serge Hallyn <[email protected]>
2 .\" Copyright 2008, 2012, 2013, 2015, Michael Kerrisk <[email protected]>
3 .\" Copyright 2024, Alejandro Colomar <[email protected]>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH PR_CAPBSET_DROP 2const 2024-06-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 PR_CAPBSET_DROP
10 \-
11 drop a capability from the calling thread's capability bounding set
12 .SH LIBRARY
13 Standard C library
14 .RI ( libc ", " \-lc )
15 .SH SYNOPSIS
16 .nf
17 .BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
18 .B #include <sys/prctl.h>
19 .P
20 .BI "int prctl(PR_CAPBSET_DROP, long " cap );
21 .fi
22 .SH DESCRIPTION
23 Drop the capability specified by
24 .I cap
25 from the calling thread's capability bounding set.
26 Any children of the calling thread will inherit the newly
27 reduced bounding set.
28 .SH RETURN VALUE
29 On success,
30 0 is returned.
31 On error, \-1 is returned, and
32 .I errno
33 is set to indicate the error.
34 .SH ERRORS
35 .TP
36 .B EINVAL
37 File capabilities are not enabled in the kernel.
38 .TP
39 .B EINVAL
40 .I cap
41 does not specify a valid capability.
42 .TP
43 .B EPERM
44 The caller does not have the
45 .B CAP_SETPCAP
46 capability.
47 .SH VERSIONS
48 A higher-level interface layered on top of this operation is provided in the
49 .BR libcap (3)
50 library in the form of
51 .BR cap_drop_bound (3).
52 .SH STANDARDS
53 Linux.
54 .SH HISTORY
55 Linux 2.6.25.
56 .SH SEE ALSO
57 .BR prctl (2),
58 .BR PR_CAPBSET_READ (2const)
59 .BR libcap (3),
60 .BR cap_drop_bound (3)