Linux 5.7.7
[linux/fpc-iii.git] / tools / build / feature / test-libcap.c
blobd2a2e152195f976bbac0262594580de6de1f309e
1 // SPDX-License-Identifier: GPL-2.0
2 #include <sys/capability.h>
3 #include <linux/capability.h>
5 int main(void)
7 cap_flag_value_t val;
8 cap_t caps = cap_get_proc();
10 if (!caps)
11 return 1;
13 if (cap_get_flag(caps, CAP_SYS_ADMIN, CAP_EFFECTIVE, &val) != 0)
14 return 1;
16 if (cap_free(caps) != 0)
17 return 1;
19 return 0;