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.17-553-g87f5185


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  87f51853ce3671f4ba9a9953de1fff952c5f7e52 (commit)
      from  3c0265394d9ffedff2b0de508602dc52e077ce5c (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=87f51853ce3671f4ba9a9953de1fff952c5f7e52

commit 87f51853ce3671f4ba9a9953de1fff952c5f7e52
Author: Roland McGrath <roland@hack.frob.com>
Date:   Tue Apr 23 15:28:59 2013 -0700

    Add generic POSIX implementation of C11 timespec_get.

diff --git a/ChangeLog b/ChangeLog
index 9d283f4..b5a2c70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-23  Roland McGrath  <roland@hack.frob.com>
+
+	* sysdeps/posix/timespec_get.c: New file.
+
 2013-04-23  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/power5/fpu/s_modf.c: New file: modf optimization for
diff --git a/sysdeps/posix/timespec_get.c b/sysdeps/posix/timespec_get.c
new file mode 100644
index 0000000..22a06c8
--- /dev/null
+++ b/sysdeps/posix/timespec_get.c
@@ -0,0 +1,38 @@
+/* timespec_get -- C11 interface to sample a clock.  Generic POSIX.1 version.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+
+
+/* Set TS to calendar time based in time base BASE.  */
+int
+timespec_get (struct timespec *ts, int base)
+{
+  switch (base)
+    {
+    case TIME_UTC:
+      if (clock_gettime (CLOCK_REALTIME, ts) < 0)
+        return 0;
+      break;
+
+    default:
+      return 0;
+    }
+
+  return base;
+}

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

Summary of changes:
 ChangeLog                              |    4 ++++
 {time => sysdeps/posix}/timespec_get.c |   13 ++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)
 copy {time => sysdeps/posix}/timespec_get.c (77%)


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]