1 //===-- common_posix.cpp ----------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "gwp_asan/common.h"
12 #include <sys/syscall.h> // IWYU pragma: keep
13 // IWYU pragma: no_include <syscall.h>
18 uint64_t getThreadID() {
20 return syscall(SYS_gettid
);
22 return kInvalidThreadID
;
26 } // namespace gwp_asan