[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <309becd325626e04015ad7b5f6fc701e569f918d.1626966805.git.rickyman7@gmail.com>
Date: Thu, 22 Jul 2021 17:34:14 +0200
From: Riccardo Mancini <rickyman7@...il.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Riccardo Mancini <rickyman7@...il.com>,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: [PATCH 1/3] tools libc_compat: add gettid
This patch adds gettid to libc_compat.h, since it was added in glibc
2.30 and is not available in previous versions.
The function is defined only if the HAVE_GETTID is not defined.
Signed-off-by: Riccardo Mancini <rickyman7@...il.com>
---
tools/include/tools/libc_compat.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/include/tools/libc_compat.h b/tools/include/tools/libc_compat.h
index e907ba6f15e532b6..58762c9c49c22ef1 100644
--- a/tools/include/tools/libc_compat.h
+++ b/tools/include/tools/libc_compat.h
@@ -17,4 +17,11 @@ static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
return realloc(ptr, bytes);
}
#endif
+
+#ifndef HAVE_GETTID
+static inline pid_t gettid(void)
+{
+ return (pid_t)syscall(__NR_gettid);
+}
+#endif
#endif
--
2.31.1
Powered by blists - more mailing lists