From 4490c6901a69096b1d78fa6eb8f2e89373235fd4 Mon Sep 17 00:00:00 2001 From: Brian Coutinho Date: Thu, 13 Apr 2023 12:30:20 -0700 Subject: [PATCH] Add get pid function (#130) Summary: Pull Request resolved: https://github.com/facebookincubator/dynolog/pull/130 as above Reviewed By: jayesh92 Differential Revision: D44921379 fbshipit-source-id: 311aa293b72191711168ab53df45b579d7c11bb1 --- hbt/src/common/Defs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbt/src/common/Defs.h b/hbt/src/common/Defs.h index 3a31f453..59d15c21 100644 --- a/hbt/src/common/Defs.h +++ b/hbt/src/common/Defs.h @@ -30,6 +30,10 @@ inline pid_t gettid() noexcept { return static_cast(syscall(SYS_gettid)); } +inline pid_t getpid() noexcept { + return static_cast(syscall(SYS_gettid)); +} + #endif // Branch hint macros. C++20 will include them as part of language.