projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR29482 - strip: heap-buffer-overflow
[binutils-gdb.git]
/
libiberty
/
getruntime.c
diff --git
a/libiberty/getruntime.c
b/libiberty/getruntime.c
index 3f7dc0d117a75f4ab0826eae70abf6419406a2c0..daaa85fb7fb0b9550a2c000e5ca4972b5e8a8845 100644
(file)
--- a/
libiberty/getruntime.c
+++ b/
libiberty/getruntime.c
@@
-1,5
+1,5
@@
/* Return time used so far, in microseconds.
/* Return time used so far, in microseconds.
- Copyright (C) 1994
, 1999, 200
2 Free Software Foundation, Inc.
+ Copyright (C) 1994
-202
2 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@
-14,8
+14,8
@@
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
You should have received a copy of the GNU Library General Public
License along with libiberty; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
-Boston, MA 0211
1-1307
, USA. */
+not, write to the Free Software Foundation, Inc., 5
1 Franklin Street - Fifth Floor
,
+Boston, MA 0211
0-1301
, USA. */
#include "config.h"
#include "config.h"
@@
-65,6
+65,10
@@
Boston, MA 02111-1307, USA. */
#define CLOCKS_PER_SEC 1
#endif
#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
#ifdef _SC_CLK_TCK
#define GNU_HZ sysconf(_SC_CLK_TCK)
#else
@@
-90,12
+94,12
@@
process started.
*/
long
*/
long
-get_run_time ()
+get_run_time (
void
)
{
#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
struct rusage rusage;
{
#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
struct rusage rusage;
- getrusage (
0
, &rusage);
+ getrusage (
RUSAGE_SELF
, &rusage);
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 */
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 */