[PATCH] libtracefs: Define gettid() when not defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Steven Rostedt <rostedt@xxxxxxxxxxxxxxxxxxxx>

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.

Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxxxxxxxxxxx>
---
 src/tracefs-hist.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index 003715f..c0d3049 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -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;
-- 
2.30.2




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux