diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-06 20:57:01 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-05-06 20:57:01 +0000 |
commit | 29723d262a200fd27ecc9c27f63a1c7c329c6f0a (patch) | |
tree | c84425eff1ad8e35c49d867dbd132fee45ed254a /libiberty/getruntime.c | |
parent | 55ac77b45c5080c441115f93821553270b49de4d (diff) | |
download | gcc-29723d262a200fd27ecc9c27f63a1c7c329c6f0a.tar.gz |
Fred Fish <fnf@be.com>
* configure.in (sys/resource.h): Add to AC_CHECK_HEADERS list.
* getruntime.c: Only attempt to include sys/resource.h and
use getrusage if both HAVE_GETRUSAGE and HAVE_SYS_RESOURCE_H
are defined.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/getruntime.c')
-rw-r--r-- | libiberty/getruntime.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index 74f4dd5b307..c7a33d78d7c 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */ #include <time.h> -#ifdef HAVE_GETRUSAGE +#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) #include <sys/time.h> #include <sys/resource.h> #endif @@ -54,7 +54,7 @@ Boston, MA 02111-1307, USA. */ long get_run_time () { -#ifdef HAVE_GETRUSAGE +#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) struct rusage rusage; getrusage (0, &rusage); |