Skip to contentSkip to conversation

glibcism in src/skins/posix/thread.c

PATCH In review Fillod Stephane 2 participants 2 messages Apr 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glibcism in src/skins/posix/thread.c

Hi,

Here's attached a patch working around a glibcism. It is necessary for uClib environment. The patch is against Xenomai 2.4.3.

Cheers

Signature · 1 line
Stephane
skins/posix/thread.c +4 -2
@@ -282,6 +282,8 @@
 	char vers[128];
 	pthread_attr_init(&default_attr);
 	linuxthreads =
-		!confstr(_CS_GNU_LIBPTHREAD_VERSION, vers, sizeof(vers))
-		|| strstr(vers, "linuxthreads");
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+		!confstr(_CS_GNU_LIBPTHREAD_VERSION, vers, sizeof(vers)) ||
+#endif
+		strstr(vers, "linuxthreads");
 }
#1 lore raw
Quoted 4 lines · Fillod Stephane

Hi,

Here's attached a patch working around a glibcism. It is necessary for uClib environment. The patch is against Xenomai 2.4.3.

Already fixed in trunk, forgot to apply the patch to the v2.4.x branch. Note that your patch is slightly incorrect:
- it runs strstr in an uninitialized string;
- the result on platforms without _CS_GNU_LIBPTHREAD_VERSION is linuxthreads == 0 whereas we really want linuxthreads == 1.

Signature · 1 line
 Gilles