aboutsummaryrefslogtreecommitdiff
path: root/libiberty/getruntime.c
diff options
context:
space:
mode:
authorFred Fish <fnf@be.com>1999-05-06 20:57:01 +0000
committerRichard Henderson <rth@gcc.gnu.org>1999-05-06 13:57:01 -0700
commit6a071f4a749850d8e8d918dfb14572659aacc4b9 (patch)
treec84425eff1ad8e35c49d867dbd132fee45ed254a /libiberty/getruntime.c
parent3dde7044de9d194c0bda7b1949d0a0cc5ea773fe (diff)
downloadgcc-6a071f4a749850d8e8d918dfb14572659aacc4b9.zip
gcc-6a071f4a749850d8e8d918dfb14572659aacc4b9.tar.gz
gcc-6a071f4a749850d8e8d918dfb14572659aacc4b9.tar.bz2
Fred Fish <fnf@be.com>
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. From-SVN: r26808
Diffstat (limited to 'libiberty/getruntime.c')
-rw-r--r--libiberty/getruntime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 74f4dd5..c7a33d7 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);