X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fgetruntime.c;h=0900a19dfba64f37fa92fc2a80225982ae34eb00;hb=ff8577f64987a898e1dc5eb6afb66a404fb7bb16;hp=9d5eed191165107306441d1b07d9cf9c150b40f8;hpb=aaae08a7e4ac526975403ebb5f93b7f24ea16b90;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index 9d5eed1911..0900a19dfb 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -1,5 +1,5 @@ /* Return time used so far, in microseconds. - Copyright (C) 1994, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1994-2019 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -65,6 +65,10 @@ Boston, MA 02110-1301, USA. */ #define CLOCKS_PER_SEC 1 #endif +#ifndef RUSAGE_SELF +#define RUSAGE_SELF 0 +#endif + #ifdef _SC_CLK_TCK #define GNU_HZ sysconf(_SC_CLK_TCK) #else @@ -95,11 +99,7 @@ get_run_time (void) #if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) struct rusage rusage; -#if defined __USE_GNU && !defined __cplusplus getrusage (RUSAGE_SELF, &rusage); -#else - getrusage (0, &rusage); -#endif return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); #else /* ! HAVE_GETRUSAGE */