From a70d4200a03e29c8a4a938c5207e09793cd7d335 Mon Sep 17 00:00:00 2001 From: Brian Coutinho Date: Thu, 13 Apr 2023 13:53:03 -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: 080e42ba1b5e62d5a0363afefd5ee04539e42267 --- 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.