[AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (#94647)
[llvm-project.git] / compiler-rt / lib / gwp_asan / platform_specific / common_posix.cpp
blob0637fc2a4245576b2380fb33351bec65fba9e68e
1 //===-- common_posix.cpp ----------------------------------------*- 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 //===----------------------------------------------------------------------===//
9 #include "gwp_asan/common.h"
11 #include <stdint.h>
12 #include <sys/syscall.h> // IWYU pragma: keep
13 // IWYU pragma: no_include <syscall.h>
14 #include <unistd.h>
16 namespace gwp_asan {
18 uint64_t getThreadID() {
19 #ifdef SYS_gettid
20 return syscall(SYS_gettid);
21 #else
22 return kInvalidThreadID;
23 #endif
26 } // namespace gwp_asan