aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2015-07-08 07:05:11 +0000
committerUros Bizjak <ubizjak@gmail.com>2015-07-08 07:05:11 +0000
commita1b290da6d4ccc6f3b81f4c844fd0e4d832f25c7 (patch)
tree4a4fafb7dbc403edeb6e8753dcacdf582b206a9c /libiberty
parent104050353e3e3eb909c41f31e58ad4bb0e87bf2a (diff)
* getruntime.c (get_run_time) [__USE_GNU]: Use RUSAGE_SELF as
argument 1 of getrusage call. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@225534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/getruntime.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f2b014841aa..643d04ea265 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-08 Uros Bizjak <ubizjak@gmail.com>
+
+ * getruntime.c (get_run_time) [__USE_GNU]: Use RUSAGE_SELF as
+ argument 1 of getrusage call.
+
2015-06-01 Jason Merrill <jason@redhat.com>
* cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 82f3d2e4185..9d5eed19116 100644
--- a/libiberty/getruntime.c
+++ b/libiberty/getruntime.c
@@ -95,7 +95,11 @@ 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 */