Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 1 | From 69c62f5f3cc424b7dd0c8e4097743b39a9c48306 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 27 Jul 2019 08:48:13 -0700 |
| 4 | Subject: [lttng-tools][PATCH] check for gettid API during configure |
| 5 | |
| 6 | Add support for gettid() provided by glibc 2.30+ |
| 7 | |
| 8 | Since version 2.30 glibc provides gettid and it causes conflicts with |
| 9 | locally defined gettid(). Use the local definition of |
| 10 | gettid only if system gettid is not available. |
| 11 | |
| 12 | https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD<Paste> |
| 13 | |
| 14 | Upstream-Status: Pending |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | --- |
| 17 | configure.ac | 2 +- |
| 18 | src/common/compat/tid.h | 3 ++- |
| 19 | 2 files changed, 3 insertions(+), 2 deletions(-) |
| 20 | |
| 21 | diff --git a/configure.ac b/configure.ac |
| 22 | index 7b99f5c..e4bd82c 100644 |
| 23 | --- a/configure.ac |
| 24 | +++ b/configure.ac |
| 25 | @@ -190,7 +190,7 @@ AC_CHECK_HEADERS([ \ |
| 26 | # Basic functions check |
| 27 | AC_CHECK_FUNCS([ \ |
| 28 | atexit bzero clock_gettime dup2 fdatasync fls ftruncate \ |
| 29 | - gethostbyname gethostname getpagesize localtime_r memchr memset \ |
| 30 | + gethostbyname gethostname getpagesize gettid localtime_r memchr memset \ |
| 31 | mkdir munmap putenv realpath rmdir socket strchr strcspn strdup \ |
| 32 | strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul \ |
| 33 | strtoull dirfd gethostbyname2 getipnodebyname epoll_create1 \ |
| 34 | diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h |
| 35 | index 40f562f..aa07a85 100644 |
| 36 | --- a/src/common/compat/tid.h |
| 37 | +++ b/src/common/compat/tid.h |
| 38 | @@ -25,6 +25,7 @@ |
| 39 | #ifndef LTTNG_TID_H |
| 40 | #define LTTNG_TID_H |
| 41 | |
| 42 | +#if !HAVE_GETTID |
| 43 | #ifdef __linux__ |
| 44 | #include <syscall.h> |
| 45 | #endif |
| 46 | @@ -47,5 +48,5 @@ static inline pid_t gettid(void) |
| 47 | return getpid(); |
| 48 | } |
| 49 | #endif |
| 50 | - |
| 51 | +#endif /* HAVE_GETTID */ |
| 52 | #endif /* LTTNG_TID_H */ |
| 53 | -- |
| 54 | 2.22.0 |
| 55 | |