mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 19:03:59 +08:00
getruntime.c (get_run_time): Use RUSAGE_SELF as argument 1 of getrusage call.
* getruntime.c (get_run_time) [__USE_GNU]: Use RUSAGE_SELF as argument 1 of getrusage call. From-SVN: r225534
This commit is contained in:
parent
89c6819e5f
commit
62ee314561
@ -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>
|
2015-06-01 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
* cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
|
* cp-demangle.c (cplus_demangle_type): Handle arguments to vendor
|
||||||
|
@ -95,7 +95,11 @@ get_run_time (void)
|
|||||||
#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
|
#if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H)
|
||||||
struct rusage rusage;
|
struct rusage rusage;
|
||||||
|
|
||||||
|
#if defined __USE_GNU && !defined __cplusplus
|
||||||
|
getrusage (RUSAGE_SELF, &rusage);
|
||||||
|
#else
|
||||||
getrusage (0, &rusage);
|
getrusage (0, &rusage);
|
||||||
|
#endif
|
||||||
return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
|
return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
|
||||||
+ rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
|
+ rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
|
||||||
#else /* ! HAVE_GETRUSAGE */
|
#else /* ! HAVE_GETRUSAGE */
|
||||||
|
Loading…
Reference in New Issue
Block a user