• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===--- Definition of a type for a futex word ------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_FUTEX_WORD_H
10 #define LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_FUTEX_WORD_H
11 
12 #include <stdint.h>
13 #include <sys/syscall.h>
14 namespace LIBC_NAMESPACE {
15 
16 // Futexes are 32 bits in size on all platforms, including 64-bit platforms.
17 using FutexWordType = uint32_t;
18 
19 #if SYS_futex
20 constexpr auto FUTEX_SYSCALL_ID = SYS_futex;
21 #elif defined(SYS_futex_time64)
22 constexpr auto FUTEX_SYSCALL_ID = SYS_futex_time64;
23 #else
24 #error "futex and futex_time64 syscalls not available."
25 #endif
26 
27 } // namespace LIBC_NAMESPACE
28 
29 #endif // LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_FUTEX_WORD_H
30