* sysdeps/unix/sysv/linux/x86_64/sys/procfs.h [__WORDSIZE == 32]
[glibc.git] / fedora / glibc-nptl-check.patch
blob48951ea5e8b2f2de553d7ffa937e42fd50a546cc
1 --- libc/sysdeps/unix/sysv/linux/dl-osinfo.h.jj 2002-12-10 09:09:24.000000000 -0500
2 +++ libc/sysdeps/unix/sysv/linux/dl-osinfo.h 2003-05-20 17:05:37.000000000 -0400
3 @@ -22,6 +22,7 @@
4 #include <sys/sysctl.h>
5 #include <sys/utsname.h>
6 #include "kernel-features.h"
7 +#include <sysdep.h>
9 #ifndef MIN
10 # define MIN(a,b) (((a)<(b))?(a):(b))
11 @@ -37,8 +38,29 @@ dl_fatal (const char *str)
12 _dl_dprintf (2, str);
13 _exit (1);
15 -#endif
17 +static inline void
18 +__attribute__ ((always_inline))
19 +dl_redhat_nptl_check (const char *cp)
21 + cp = strchr (cp, 'n');
22 + if (__builtin_expect (cp == NULL || cp[1] != 'p'
23 + || cp[2] != 't' || cp[3] != 'l', 0)
24 + && GLRO(dl_osversion) < 0x20545
25 + && GLRO(dl_osversion) > 0x20413)
26 + {
27 +#ifdef __NR_set_tid_address
28 + INTERNAL_SYSCALL_DECL (err);
29 + int ret;
30 + ret = INTERNAL_SYSCALL (set_tid_address, err, 1, NULL);
31 + if (INTERNAL_SYSCALL_ERROR_P (ret, err))
32 +#endif
33 + GLRO(dl_osversion) = 0x20413;
34 + }
36 +#else
37 +#define dl_redhat_nptl_check(cp)
38 +#endif
40 #define DL_SYSDEP_OSCHECK(FATAL) \
41 do { \
42 @@ -105,5 +127,6 @@ dl_fatal (const char *str)
43 FATAL ("FATAL: kernel too old\n"); \
45 GLRO(dl_osversion) = version; \
46 + dl_redhat_nptl_check (cp); \
47 } \
48 } while (0)