summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/alpha/getsysstats.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-04 16:01:55 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-04 16:01:55 +0000
commit2f638d5e5aba6f39a446143e66ed926406c0ae9d (patch)
tree57d8d5aca7f9294aa4dfdd982cc6c2ec2afc57b0 /sysdeps/unix/sysv/linux/alpha/getsysstats.c
parent630b9a59e11b1f2c0a2e7a41c1100f959c831cd3 (diff)
Update.
1999-08-04 Andreas Schwab <schwab@suse.de> * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER): Initialize result to one. (GET_NPROCS_CONF_PARSER): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha/getsysstats.c')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getsysstats.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/getsysstats.c b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
index 8588903c89..27355b5fe4 100644
--- a/sysdeps/unix/sysv/linux/alpha/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/alpha/getsysstats.c
@@ -20,35 +20,35 @@
/* We need to define a special parser for /proc/cpuinfo. */
-#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
- do \
- { \
- (RESULT) = 0; \
- /* 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. */ \
- while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
- if (sscanf (BUFFER, "CPUs probed %*d active %d", &(RESULT)) == 1) \
- break; \
- } \
+#define GET_NPROCS_PARSER(FP, BUFFER, 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. */ \
+ (RESULT) = 1; \
+ while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
+ if (sscanf (BUFFER, "CPUs probed %*d active %d", &(RESULT)) == 1) \
+ break; \
+ } \
while (0)
/* On the Alpha we can distinguish between the number of configured and
active cpus. */
-#define GET_NPROCS_CONF_PARSER(FP, BUFFER, RESULT) \
- do \
- { \
- (RESULT) = 0; \
- /* Find the line that contains the information about the number of \
- probed cpus. We don't have to fear extremely long lines since \
- the kernel will not generate them. 8192 bytes are really \
- enough. */ \
- while (fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \
- if (sscanf (buffer, "CPUs probed %d", &(RESULT)) == 1) \
- break; \
- } \
+#define GET_NPROCS_CONF_PARSER(FP, BUFFER, RESULT) \
+ do \
+ { \
+ /* Find the line that contains the information about the number of \
+ probed 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. */ \
+ (RESULT) = 1; \
+ while (fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \
+ if (sscanf (buffer, "CPUs probed %d", &(RESULT)) == 1) \
+ break; \
+ } \
while (0)
#include <sysdeps/unix/sysv/linux/getsysstats.c>