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