• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_IPC_LOCK
28 # define CAP_IPC_LOCK         14
29 #endif
30 
31 #ifndef CAP_SYS_CHROOT
32 # define CAP_SYS_CHROOT       18
33 #endif
34 
35 #ifndef CAP_SYS_ADMIN
36 # define CAP_SYS_ADMIN        21
37 #endif
38 
39 #ifndef CAP_SYS_TIME
40 # define CAP_SYS_TIME         25
41 #endif
42 
43 #ifndef CAP_AUDIT_READ
44 # define CAP_AUDIT_READ       37
45 #endif
46 
47 #ifndef CAP_SYS_RESOURCE
48 # define CAP_SYS_RESOURCE     24
49 #endif
50 
51 #ifndef CAP_BPF
52 # define CAP_BPF              39
53 #endif
54 
55 #ifndef CAP_TO_INDEX
56 # define CAP_TO_INDEX(x)     ((x) >> 5)
57 #endif
58 
59 #ifndef CAP_TO_MASK
60 # define CAP_TO_MASK(x)      (1 << ((x) & 31))
61 #endif
62 
63 #endif /* LAPI_CAPABILITY_H__ */
64