repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git]
/
tools
/
build
/
feature
/
test-libcap.c
blob
d2a2e152195f976bbac0262594580de6de1f309e
1
// SPDX-License-Identifier: GPL-2.0
2
#include <sys/capability.h>
3
#include <linux/capability.h>
4
5
int
main
(
void
)
6
{
7
cap_flag_value_t val
;
8
cap_t caps
=
cap_get_proc
();
9
10
if
(!
caps
)
11
return
1
;
12
13
if
(
cap_get_flag
(
caps
,
CAP_SYS_ADMIN
,
CAP_EFFECTIVE
, &
val
) !=
0
)
14
return
1
;
15
16
if
(
cap_free
(
caps
) !=
0
)
17
return
1
;
18
19
return
0
;
20
}