1 // SPDX-License-Identifier: GPL-2.0
6 #ifdef HAVE_LIBCAP_SUPPORT
10 #include <sys/capability.h>
12 bool perf_cap__capable(cap_value_t cap
)
15 cap_t caps
= cap_get_proc();
20 if (cap_get_flag(caps
, cap
, CAP_EFFECTIVE
, &val
) != 0)
23 if (cap_free(caps
) != 0)
26 return val
== CAP_SET
;
29 #endif /* HAVE_LIBCAP_SUPPORT */