Fix: namespace our gettid wrapper
A message that is not in the archive (sent off-list or not yet received): [email protected]
Merged in master, stable-2.11, and stable-2.10.
Thanks!
Jérémie
Quoted 66 lines · Michael Jeanson
Since glibc 2.30, a gettid wrapper was added that conflicts with our static declaration. Namespace our wrapper so there is no conflict, we'll add support for the glibc provided wrapper in a further commit.
Signed-off-by Michael Jeanson <[email protected]>--- src/common/compat/tid.h | 12 +++++++----- src/common/error.h | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-)src/common/compat/tid.h +7
-5@@ -29,23 +29,25 @@#include <syscall.h> #endif -#if defined(_syscall0) -_syscall0(pid_t, gettid) -#elif defined(__NR_gettid) +#if defined(__NR_gettid) +#include <unistd.h> -static inline pid_t gettid (void ) +static inline pid_t lttng_gettid (void ) {return syscall (__NR_gettid); } +#else +#include <sys/types.h> #include <unistd.h> /* Fall-back on getpid for tid if not available. */ -static inline pid_t gettid (void ) +static inline pid_t lttng_gettid (void ) {return getpid (); } +#endif #endif /* LTTNG_TID_H */ src/common/error.h +2
-2@@ -151,11 +151,11 @@ static inline void __lttng_print_check_abort(enum lttng_error_level type)/* Three level of debug. Use -v, -vv or -vvv for the levels */ #define _ERRMSG(msg, type, fmt, args...) __lttng_print(type, msg \ " - %s [%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n", \ - log_add_time(), (long) getpid(), (long) gettid(), ## args, __func__) + log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args, __func__) #define _ERRMSG_NO_LOC(msg, type, fmt, args...) __lttng_print(type, msg \ " - %s [%ld/%ld]: " fmt "\n", \ - log_add_time(), (long) getpid(), (long) gettid(), ## args) + log_add_time(), (long) getpid(), (long) lttng_gettid(), ## args) #define MSG(fmt, args...) \ __lttng_print(PRINT_MSG, fmt "\n", ## args)Signature · 1 line
2.17.1