1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * Copyright (c) 2019 Richard Palethorpe <rpalethorpe@suse.com> 4 */ 5 6 #ifndef LAPI_CAPABILITY_H 7 #define LAPI_CAPABILITY_H 8 9 #include "config.h" 10 11 #ifdef HAVE_SYS_CAPABILITY_H 12 # include <sys/capability.h> 13 /** 14 * Some old libcap-devel(1.96~2.16) define _LINUX_TYPES_H in 15 * sys/capability.h that makes ltp-lib cann't include linux/types.h 16 * essentially. Here undefine it if include such old header-file. 17 */ 18 # ifndef HAVE_NEWER_LIBCAP 19 # undef _LINUX_TYPES_H 20 # endif 21 #endif 22 23 #ifndef CAP_NET_RAW 24 # define CAP_NET_RAW 13 25 #endif 26 27 #ifndef CAP_SYS_ADMIN 28 # define CAP_SYS_ADMIN 21 29 #endif 30 31 #ifndef CAP_AUDIT_READ 32 # define CAP_AUDIT_READ 37 33 #endif 34 35 #ifndef CAP_TO_INDEX 36 # define CAP_TO_INDEX(x) ((x) >> 5) 37 #endif 38 39 #ifndef CAP_TO_MASK 40 # define CAP_TO_MASK(x) (1 << ((x) & 31)) 41 #endif 42 43 #endif 44