1 // Copyright 2014 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_FUTEX_H_
6 #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FUTEX_H_
8 #if !defined(__native_client_nonsfi__)
9 #include <linux/futex.h>
10 #endif // !defined(__native_client_nonsfi__)
12 #if !defined(FUTEX_WAIT)
16 #if !defined(FUTEX_WAKE)
20 #if !defined(FUTEX_FD)
24 #if !defined(FUTEX_REQUEUE)
25 #define FUTEX_REQUEUE 3
28 #if !defined(FUTEX_CMP_REQUEUE)
29 #define FUTEX_CMP_REQUEUE 4
32 #if !defined(FUTEX_WAKE_OP)
33 #define FUTEX_WAKE_OP 5
36 #if !defined(FUTEX_LOCK_PI)
37 #define FUTEX_LOCK_PI 6
40 #if !defined(FUTEX_UNLOCK_PI)
41 #define FUTEX_UNLOCK_PI 7
44 #if !defined(FUTEX_TRYLOCK_PI)
45 #define FUTEX_TRYLOCK_PI 8
48 #if !defined(FUTEX_WAIT_BITSET)
49 #define FUTEX_WAIT_BITSET 9
52 #if !defined(FUTEX_WAKE_BITSET)
53 #define FUTEX_WAKE_BITSET 10
56 #if !defined(FUTEX_WAIT_REQUEUE_PI)
57 #define FUTEX_WAIT_REQUEUE_PI 11
60 #if !defined(FUTEX_CMP_REQUEUE_PI)
61 #define FUTEX_CMP_REQUEUE_PI 12
64 #if !defined(FUTEX_PRIVATE_FLAG)
65 #define FUTEX_PRIVATE_FLAG 128
68 #if !defined FUTEX_CLOCK_REALTIME
69 #define FUTEX_CLOCK_REALTIME 256
72 #if !defined(FUTEX_CMD_MASK)
73 #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
76 #if !defined(FUTEX_CMP_REQUEUE_PI_PRIVATE)
77 #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
80 #if !defined(FUTEX_UNLOCK_PI_PRIVATE)
81 #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
84 #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FUTEX_H_