This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.14-237-gd53a73a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  d53a73acdbf6ac6eb99cd06f5dd695da58d9e8f5 (commit)
      from  42a36f6670797912fa4c2b0e0cb3792e88c1a3bc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d53a73acdbf6ac6eb99cd06f5dd695da58d9e8f5

commit d53a73acdbf6ac6eb99cd06f5dd695da58d9e8f5
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Tue Sep 6 20:22:37 2011 -0400

    Avoid gettimeofday vsyscall

diff --git a/ChangeLog b/ChangeLog
index fd78d99..32e74d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-06  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Don't use
+	gettimeofday vsyscall, just use time.
+
 2011-09-06  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Include
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index b9bae3d..7feb7a1 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -37,15 +37,6 @@
 #include <not-cancel.h>
 #include <kernel-features.h>
 
-#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
-
 
 /* How we can determine the number of available processors depends on
    the configuration.  There is currently (as of version 2.0.21) no
@@ -141,17 +132,10 @@ __get_nprocs ()
   static int cached_result;
   static time_t timestamp;
 
-#ifdef __ASSUME_POSIX_TIMERS
-  struct timespec ts;
-  INTERNAL_SYSCALL_DECL (err);
-  INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts);
-#else
-  struct timeval ts;
-  __gettimeofday (&ts, NULL);
-#endif
+  time_t now = time (NULL);
   time_t prev = timestamp;
   atomic_read_barrier ();
-  if (ts.tv_sec == prev)
+  if (now == prev)
     return cached_result;
 
   /* XXX Here will come a test for the new system call.  */
@@ -243,7 +227,7 @@ __get_nprocs ()
  out:
   cached_result = result;
   atomic_write_barrier ();
-  timestamp = ts.tv_sec;
+  timestamp = now;
 
   return result;
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |    5 +++++
 sysdeps/unix/sysv/linux/getsysstats.c |   22 +++-------------------
 2 files changed, 8 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]