* 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.
This commit is contained in:
Richard Henderson
1999-05-06 20:59:17 +00:00
parent 03987ceda1
commit 33fbbfbc00
4 changed files with 11 additions and 4 deletions

View File

@@ -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);