summaryrefslogtreecommitdiff
path: root/libiberty/getruntime.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1999-05-06 20:59:17 +0000
committerRichard Henderson <rth@redhat.com>1999-05-06 20:59:17 +0000
commit4ba4922d82c9c6731db37e9f6cbbb561ec0ca35a (patch)
treeb7a2d833081a1d509019f124465e08c1c8b32cf6 /libiberty/getruntime.c
parente238e51e090018da87f7fd3f8872abaacd2330be (diff)
downloadgdb-4ba4922d82c9c6731db37e9f6cbbb561ec0ca35a.tar.gz
* 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.
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 6e70773bd94..b855ea6e82f 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
@@ -66,7 +66,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);