Skip to contentSkip to conversation

Fix: strerror_r behavior is glibc specific

PATCH New Michael Jeanson 2 participants 4 messages May 30, 2016 – May 31, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/4 Fix: strerror_r behavior is glibc specific

---
 include/usterr-signal-safe.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/usterr-signal-safe.h +1 -1
index bc68fbf..1df5ada 100644
@@ -106,7 +106,7 @@ do {									\
 #define ERR(fmt, args...)	ERRMSG("Error: " fmt, ## args)
 #define BUG(fmt, args...)	ERRMSG("BUG: " fmt, ## args)
 
-#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
+#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
 /*
  * Version using XSI strerror_r.
  */
Signature · 6 lines
2.7.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

PATCH 3/4 Fix: use limits.h in ust-elf test

In reply to a message not in the archive
---
 tests/ust-elf/prog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/ust-elf/prog.c +1 -1
index da4f396..4036563 100644
@@ -16,7 +16,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <linux/limits.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
Signature · 6 lines
2.7.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#3 lore raw

PATCH 4/4 Use config.h to detect sched_getcpu support

In reply to a message not in the archive
---
 libringbuffer/getcpu.h | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
libringbuffer/getcpu.h +5 -7
index fbddb79..7b009dc 100644
@@ -22,6 +22,7 @@
 #include <urcu/compiler.h>
 #include <urcu/system.h>
 #include <urcu/arch.h>
+#include <config.h>
 
 void lttng_ust_getcpu_init(void);
 
@@ -47,10 +48,7 @@ int lttng_ust_get_cpu_internal(void)
  */
 #ifdef __linux__
 
-/* old uClibc versions didn't have sched_getcpu */
-#if defined(__UCLIBC__) && __UCLIBC_MAJOR__ == 0 && \
-	(__UCLIBC_MINOR__ < 9 || \
-	 (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32))
+#if !HAVE_SCHED_GETCPU
 #include <sys/syscall.h>
 #define __getcpu(cpu, node, cache)	syscall(__NR_getcpu, cpu, node, cache)
 /*
@@ -64,9 +62,9 @@ int lttng_ust_get_cpu_internal(void)
 	ret = __getcpu(&cpu, NULL, NULL);
 	if (caa_unlikely(ret < 0))
 		return 0;
-	return c;
+	return cpu;
 }
-#else /* __UCLIBC__ */
+#else /* HAVE_SCHED_GETCPU */
 #include <sched.h>
 
 /*
@@ -82,7 +80,7 @@ int lttng_ust_get_cpu_internal(void)
 		return 0;
 	return cpu;
 }
-#endif	/* __UCLIBC__ */
+#endif	/* HAVE_SCHED_GETCPU */
 
 #elif (defined(__FreeBSD__) || defined(__CYGWIN__))
 
Signature · 6 lines
2.7.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#4 lore raw

Re: [PATCH lttng-ust 1/4] Add support for musl libc to ust-dlfcn.h

In reply to a message not in the archive

All merged into master, stable-2.8. The commit marked "fix" that apply to 2.7 has been backported.

Quoted 28 lines · ----- On May 30, 2016, at 10:31 PM, Michael Jeanson [email protected] wrote:

---
include/lttng/ust-dlfcn.h | 4 ++++

1 file changed, 4 insertions(+)
include/lttng/ust-dlfcn.h +4 -1
index c92f1bb..7471d94 100644
@@ -31,6 +31,7 @@
 #error "Please include lttng/ust-dlfcn.h before dlfcn.h."
 #endif /* _DLFCN_H */
 
+#ifdef __GLIBC__
 /*
 * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see
 * THROW annotation). Unfortunately, this is not in sync with reality,
@@ -57,5 +58,8 @@ extern int dlclose(void *__handle) __nonnull ((1));
 extern void *dlsym(void *__restrict __handle,
 		__const char *__restrict __name) __nonnull ((2));
 extern char *dlerror(void);
+#else
+#include <dlfcn.h>
+#endif /* __GLIBC__ */
 
 #endif /* _LTTNG_UST_DLFCN_H */
--

2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev