lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [lttng-tools][PATCH] check for gettid API during configure
@ 2019-07-27 15:56 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2019-07-27 15:56 UTC (permalink / raw)
  To: lttng-dev

Add support for gettid() provided by glibc 2.30+

Since version 2.30 glibc provides gettid and it causes conflicts with
locally defined gettid(). Use the local definition of
gettid only if system gettid is not available.

https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD<Paste>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 configure.ac            | 2 +-
 src/common/compat/tid.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7b99f5c..e4bd82c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,7 +190,7 @@ AC_CHECK_HEADERS([ \
 # Basic functions check
 AC_CHECK_FUNCS([ \
 	atexit bzero clock_gettime dup2 fdatasync fls ftruncate \
-	gethostbyname gethostname getpagesize localtime_r memchr memset \
+	gethostbyname gethostname getpagesize gettid localtime_r memchr memset \
 	mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \
 	strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \
 	strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \
diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h
index 40f562f..aa07a85 100644
--- a/src/common/compat/tid.h
+++ b/src/common/compat/tid.h
@@ -25,6 +25,7 @@
 #ifndef LTTNG_TID_H
 #define LTTNG_TID_H
 
+#if !HAVE_GETTID
 #ifdef __linux__
 #include <syscall.h>
 #endif
@@ -47,5 +48,5 @@ static inline pid_t gettid(void)
 	return getpid();
 }
 #endif
-
+#endif /* HAVE_GETTID */
 #endif /* LTTNG_TID_H */
-- 
2.22.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-27 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-27 15:56 [lttng-tools][PATCH] check for gettid API during configure Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).