diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-09-02 07:14:15 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-09-02 07:14:15 +0000 |
commit | f1c30c98b9c9720f2a542df7ae0b9cde4c162e7a (patch) | |
tree | 316c77f8647401e15d064910b7f33b0d2c84050d /sysdeps/unix/sysv/linux/getloadavg.c | |
parent | c503d3dc512a5f7947d5b3d69d784028db3a639a (diff) | |
download | glibc-f1c30c98b9c9720f2a542df7ae0b9cde4c162e7a.tar.gz glibc-f1c30c98b9c9720f2a542df7ae0b9cde4c162e7a.tar.xz glibc-f1c30c98b9c9720f2a542df7ae0b9cde4c162e7a.zip |
(CFLAGS-oldtmpfile.c): Add -fexceptions.
Diffstat (limited to 'sysdeps/unix/sysv/linux/getloadavg.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/getloadavg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/getloadavg.c b/sysdeps/unix/sysv/linux/getloadavg.c index e1a372cd5f..6ef17fe0d0 100644 --- a/sysdeps/unix/sysv/linux/getloadavg.c +++ b/sysdeps/unix/sysv/linux/getloadavg.c @@ -1,5 +1,5 @@ /* Get system load averages. Linux (/proc/loadavg) version. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #include <locale.h> #include <stdlib.h> #include <unistd.h> +#include <not-cancel.h> /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. @@ -33,7 +34,7 @@ getloadavg (double loadavg[], int nelem) { int fd; - fd = __open ("/proc/loadavg", O_RDONLY); + fd = open_not_cancel_2 ("/proc/loadavg", O_RDONLY); if (fd < 0) return -1; else @@ -42,8 +43,8 @@ getloadavg (double loadavg[], int nelem) ssize_t nread; int i; - nread = __read (fd, buf, sizeof buf - 1); - __close (fd); + nread = read_not_cancel (fd, buf, sizeof buf - 1); + close_not_cancel_no_status (fd); if (nread < 0) return -1; buf[nread - 1] = '\0'; |