10 #define __LINUX_KERNEL_VERSION 131584
12 #define DL_SYSDEP_OSCHECK(FATAL) \
14 /* Test whether the kernel is new enough. This test is only \
15 performed if the library is not compiled to run on all \
17 if (__LINUX_KERNEL_VERSION > 0) \
21 unsigned int version; \
26 /* Try the uname syscall */ \
29 /* This was not successful. Now try reading the /proc \
32 int fd = __open ("/proc/sys/kernel/osrelease", O_RDONLY); \
34 || (reslen = __read (fd, bufmem, sizeof (bufmem))) <= 0) \
35 /* This also didn't work. We give up since we cannot \
36 make sure the library can actually work. */ \
37 FATAL ("FATAL: cannot determine library version\n"); \
39 buf[MIN (reslen, (ssize_t) sizeof (bufmem) - 1)] = '\0'; \
44 /* Now convert it into a number. The string consists of at most \
49 while ((*cp >= '0') && (*cp <= '9')) \
51 unsigned int here = *cp++ - '0'; \
53 while ((*cp >= '0') && (*cp <= '9')) \
56 here += *cp++ - '0'; \
64 /* Another part following? */ \
69 version <<= 8 * (3 - parts); \
71 /* Now we can test with the required version. */ \
72 if (version < __LINUX_KERNEL_VERSION) \
73 /* Not sufficent. */ \
74 FATAL ("FATAL: kernel too old\n"); \
76 _dl_osversion = version; \
82 char bufmem
[64] = "2.6.22";
91 while ((*cp
>= '0') && (*cp
<= '9'))
93 unsigned int here
= *cp
++ - '0';
95 while ((*cp
>= '0') && (*cp
<= '9'))
106 /* Another part following? */
111 version
<<= 8 * (3 - parts
);
112 if (version
< __LINUX_KERNEL_VERSION
)