From c1592c256a9fa5039737a27ecbac537736f0b2b1 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Mon, 13 Jul 2009 23:52:54 +0200 Subject: [PATCH] Adapt alpha version of getsysstats.c to the changes in the main Linux version * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER): Change parameters and use next_line. --- ChangeLog.alpha | 6 ++++++ sysdeps/unix/sysv/linux/alpha/getsysstats.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog.alpha b/ChangeLog.alpha index 6bb3b7c..cc7e059 100644 --- a/ChangeLog.alpha +++ b/ChangeLog.alpha @@ -1,3 +1,9 @@ +2009-07-13 Aurelien Jarno + + [BZ #10158] + * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER): + Change parameters and use next_line. + 2008-11-26 Roland McGrath * sysdeps/unix/sysv/linux/alpha/wordexp.c: Contents moved to main diff --git a/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/sysdeps/unix/sysv/linux/alpha/getsysstats.c index 0e49a84..f667437 100644 --- a/sysdeps/unix/sysv/linux/alpha/getsysstats.c +++ b/sysdeps/unix/sysv/linux/alpha/getsysstats.c @@ -20,15 +20,16 @@ /* We need to define a special parser for /proc/cpuinfo. */ -#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \ +#define GET_NPROCS_PARSER(FD, BUFFER, CP, RE, BUFFER_END, RESULT) \ do \ { \ /* Find the line that contains the information about the number of \ active cpus. We don't have to fear extremely long lines since \ the kernel will not generate them. 8192 bytes are really enough. \ If there is no "CPUs ..." line then we are on a UP system. */ \ + char *l; \ (RESULT) = 1; \ - while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \ + while ((l = next_line (FD, BUFFER, &CP, &RE, BUFFER_END)) != NULL) \ if ((sscanf (BUFFER, "cpus active : %d", &(RESULT)) == 1) \ || (sscanf (BUFFER, "CPUs probed %*d active %d", \ &(RESULT)) == 1)) \ -- 2.7.4