From: Nikos Mavrogiannopoulos Date: Sat, 25 Jan 2014 09:16:06 +0000 (+0100) Subject: use RUSAGE_THREAD to obtain rusage stats to avoid becoming a bottleneck on processes... X-Git-Tag: gnutls_3_3_0pre0~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deee61b0d9e05b22e524d892daf7e11b1c330d2b;p=thirdparty%2Fgnutls.git use RUSAGE_THREAD to obtain rusage stats to avoid becoming a bottleneck on processes with many threads. --- diff --git a/lib/nettle/rnd-common.c b/lib/nettle/rnd-common.c index db64bb0e58..46f74269a7 100644 --- a/lib/nettle/rnd-common.c +++ b/lib/nettle/rnd-common.c @@ -45,7 +45,11 @@ void _rnd_get_event(struct event_st *e) gettime(&e->now); #ifdef HAVE_GETRUSAGE +#ifdef RUSAGE_THREAD + if (getrusage(RUSAGE_THREAD, &e->rusage) < 0) { +#else if (getrusage(RUSAGE_SELF, &e->rusage) < 0) { +#endif _gnutls_debug_log("getrusage failed: %s\n", strerror(errno)); abort();