summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch')
-rw-r--r--meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch
new file mode 100644
index 0000000000..c494cee604
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-check-for-gettid-API-during-configure.patch
@@ -0,0 +1,55 @@
1From 69c62f5f3cc424b7dd0c8e4097743b39a9c48306 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 27 Jul 2019 08:48:13 -0700
4Subject: [lttng-tools][PATCH] check for gettid API during configure
5
6Add support for gettid() provided by glibc 2.30+
7
8Since version 2.30 glibc provides gettid and it causes conflicts with
9locally defined gettid(). Use the local definition of
10gettid only if system gettid is not available.
11
12https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD<Paste>
13
14Upstream-Status: Pending
15Signed-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
21diff --git a/configure.ac b/configure.ac
22index 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 \
34diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h
35index 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--
542.22.0
55