[Glibc-bsd-commits] r4716 - trunk/glibc-ports/kfreebsd
Petr Salinger
ps-guest at alioth.debian.org
Tue Jul 9 19:43:48 UTC 2013
Author: ps-guest
Date: 2013-07-09 19:43:48 +0000 (Tue, 09 Jul 2013)
New Revision: 4716
Added:
trunk/glibc-ports/kfreebsd/timespec_get.c
Log:
implement timespec_get(), added in GLIBC_2.16
Added: trunk/glibc-ports/kfreebsd/timespec_get.c
===================================================================
--- trunk/glibc-ports/kfreebsd/timespec_get.c (rev 0)
+++ trunk/glibc-ports/kfreebsd/timespec_get.c 2013-07-09 19:43:48 UTC (rev 4716)
@@ -0,0 +1,46 @@
+/* Copyright (C) 2011-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>
+#include <sysdep.h>
+#include <kernel-features.h>
+
+/* Set TS to calendar time based in time base BASE. */
+
+/* if the timespec_get function is successful
+ it returns the nonzero value base;
+ otherwise, it returns zero.
+ */
+
+int
+timespec_get (ts, base)
+ struct timespec *ts;
+ int base;
+{
+ switch (base)
+ {
+ case TIME_UTC:
+ if ( 0 != __clock_gettime(CLOCK_REALTIME, ts))
+ return 0;
+ break;
+
+ default:
+ return 0;
+ }
+
+ return base;
+}
More information about the Glibc-bsd-commits
mailing list