Skip to contentSkip to conversation

libtracefs: Define gettid() when not defined

PATCH Superseded Steven Rostedt 1 participant 1 message Aug 25, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Define gettid() when not defined

From: Steven Rostedt <[email protected]>

tracefs-hist.c uses the gettid() system call, but older glibcs do not define it. Define the system call when it is not already defined.

---
 src/tracefs-hist.c | 5 +++++
 1 file changed, 5 insertions(+)
src/tracefs-hist.c +5 -0
index 003715f..c0d3049 100644
@@ -24,6 +24,11 @@
 #define ASCENDING ".ascending"
 #define DESCENDING ".descending"
 
+#ifndef gettid
+# include <sys/syscall.h>
+# define gettid() syscall(__NR_gettid)
+#endif
+
 struct tracefs_hist {
 	struct tep_handle	*tep;
 	struct tep_event	*event;
Signature · 1 line
2.30.2