|
Packit Service |
82fcde |
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
|
|
Packit Service |
82fcde |
Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library; if not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <sysdep.h>
|
|
Packit Service |
82fcde |
#include <errno.h>
|
|
Packit Service |
82fcde |
#include <time.h>
|
|
Packit Service |
82fcde |
#include "kernel-posix-cpu-timers.h"
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#ifdef HAVE_CLOCK_GETTIME_VSYSCALL
|
|
Packit Service |
82fcde |
# define HAVE_VSYSCALL
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
#include <sysdep-vdso.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
9d950c |
#include <shlib-compat.h>
|
|
Packit Service |
9d950c |
|
|
Packit Service |
22d390 |
/* Get current value of CLOCK and store it in TP. */
|
|
Packit Service |
22d390 |
int
|
|
Packit Service |
22d390 |
__clock_gettime (clockid_t clock_id, struct timespec *tp)
|
|
Packit Service |
22d390 |
{
|
|
Packit Service |
22d390 |
return INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp);
|
|
Packit Service |
22d390 |
}
|
|
Packit Service |
22d390 |
libc_hidden_def (__clock_gettime)
|
|
Packit Service |
9d950c |
|
|
Packit Service |
9d950c |
versioned_symbol (libc, __clock_gettime, clock_gettime, GLIBC_2_17);
|
|
Packit Service |
9d950c |
/* clock_gettime moved to libc in version 2.17;
|
|
Packit Service |
9d950c |
old binaries may expect the symbol version it had in librt. */
|
|
Packit Service |
9d950c |
#if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_17)
|
|
Packit Service |
9d950c |
strong_alias (__clock_gettime, __clock_gettime_2);
|
|
Packit Service |
9d950c |
compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
|
|
Packit Service |
9d950c |
#endif
|