| 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_CAPBSET_DROP 2const 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
PR_CAPBSET_DROP |
| 9 |
\- |
| 10 |
drop a capability from the calling thread's capability bounding set |
| 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 |
.BI "int prctl(PR_CAPBSET_DROP, long " cap ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
Drop the capability specified by |
| 23 |
.I cap |
| 24 |
from the calling thread's capability bounding set. |
| 25 |
Any children of the calling thread will inherit the newly |
| 26 |
reduced bounding set. |
| 27 |
.SH RETURN VALUE |
| 28 |
On success, |
| 29 |
0 is returned. |
| 30 |
On error, \-1 is returned, and |
| 31 |
.I errno |
| 32 |
is set to indicate the error. |
| 33 |
.SH ERRORS |
| 34 |
.TP |
| 35 |
.B EINVAL |
| 36 |
File capabilities are not enabled in the kernel. |
| 37 |
.TP |
| 38 |
.B EINVAL |
| 39 |
.I cap |
| 40 |
does not specify a valid capability. |
| 41 |
.TP |
| 42 |
.B EPERM |
| 43 |
The caller does not have the |
| 44 |
.B CAP_SETPCAP |
| 45 |
capability. |
| 46 |
.SH VERSIONS |
| 47 |
A higher-level interface layered on top of this operation is provided in the |
| 48 |
.BR libcap (3) |
| 49 |
library in the form of |
| 50 |
.BR cap_drop_bound (3). |
| 51 |
.SH STANDARDS |
| 52 |
Linux. |
| 53 |
.SH HISTORY |
| 54 |
Linux 2.6.25. |
| 55 |
.SH SEE ALSO |
| 56 |
.BR prctl (2), |
| 57 |
.BR PR_CAPBSET_READ (2const), |
| 58 |
.BR libcap (3), |
| 59 |
.BR cap_drop_bound (3) |