![]() |
|
|||
0001 // SPDX-License-Identifier: GPL-2.0 0002 /* 0003 * Capability utilities 0004 */ 0005 0006 #ifdef HAVE_LIBCAP_SUPPORT 0007 0008 #include "cap.h" 0009 #include <stdbool.h> 0010 #include <sys/capability.h> 0011 0012 bool perf_cap__capable(cap_value_t cap) 0013 { 0014 cap_flag_value_t val; 0015 cap_t caps = cap_get_proc(); 0016 0017 if (!caps) 0018 return false; 0019 0020 if (cap_get_flag(caps, cap, CAP_EFFECTIVE, &val) != 0) 0021 val = CAP_CLEAR; 0022 0023 if (cap_free(caps) != 0) 0024 return false; 0025 0026 return val == CAP_SET; 0027 } 0028 0029 #endif /* HAVE_LIBCAP_SUPPORT */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |