1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/ports-2.10.1/500-alpha-add-getsystats-support.patch Sun May 08 14:14:40 2011 +0200
1.3 @@ -0,0 +1,31 @@
1.4 +2009-05-16 Aurelien Jarno <aurelien@aurel32.net>
1.5 +
1.6 + * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
1.7 + Change parameters and use next_line.
1.8 +
1.9 + ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c | 5 +++--
1.10 + 1 file changed, 3 insertions(+), 2 deletions(-)
1.11 +
1.12 +diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c
1.13 +--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c 2009-05-16 10:36:20.000000000 +0200
1.14 ++++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/unix/sysv/linux/alpha/getsysstats.c 2009-11-13 00:51:07.000000000 +0100
1.15 +@@ -20,15 +20,16 @@
1.16 +
1.17 +
1.18 + /* We need to define a special parser for /proc/cpuinfo. */
1.19 +-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
1.20 ++#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \
1.21 + do \
1.22 + { \
1.23 + /* Find the line that contains the information about the number of \
1.24 + active cpus. We don't have to fear extremely long lines since \
1.25 + the kernel will not generate them. 8192 bytes are really enough. \
1.26 + If there is no "CPUs ..." line then we are on a UP system. */ \
1.27 ++ char *l; \
1.28 + (RESULT) = 1; \
1.29 +- while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
1.30 ++ while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \
1.31 + if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1) \
1.32 + || (sscanf (BUFFER, "CPUs probed %*d active %d", \
1.33 + &(RESULT)) == 1)) \
1.34 +diff -durN glibc-2.10.1.orig/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c glibc-2.10.1/ports/sysdeps/unix/sysv/linux/alpha/getsysstats.c