1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_CAPABILITY_H_
6 #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_CAPABILITY_H_
10 // The following macros are taken from linux/capability.h.
11 // We only support capability version 3, which was introduced in Linux 2.6.26.
12 #ifndef _LINUX_CAPABILITY_VERSION_3
13 #define _LINUX_CAPABILITY_VERSION_3 0x20080522
15 #ifndef _LINUX_CAPABILITY_U32S_3
16 #define _LINUX_CAPABILITY_U32S_3 2
19 #define CAP_TO_INDEX(x) ((x) >> 5) // 1 << 5 == bits in __u32
22 #define CAP_TO_MASK(x) (1 << ((x) & 31)) // mask for indexed __u32
24 #ifndef CAP_SYS_CHROOT
25 #define CAP_SYS_CHROOT 18
28 #define CAP_SYS_ADMIN 21
42 #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_CAPABILITY_H_