Warning: That file was not part of the compilation database. It may have many parsing errors.

1/* Copyright (C) 2018-2019 Free Software Foundation, Inc.
2
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
18
19/* Get the current time of day and timezone information,
20 putting it into *tv and *tz. If tz is null, *tz is not filled.
21 Returns 0 on success, -1 on errors. */
22
23#ifdef SHARED
24
25# define __gettimeofday __redirect___gettimeofday
26# include <sys/time.h>
27# undef __gettimeofday
28# define HAVE_VSYSCALL
29# include <dl-vdso.h>
30# include <sysdep-vdso.h>
31
32/* Used as a fallback in the ifunc resolver if VDSO is not available
33 and for libc.so internal __gettimeofday calls. */
34
35static int
36__gettimeofday_vsyscall (struct timeval *tv, struct timezone *tz)
37{
38 return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
39}
40
41/* PREPARE_VERSION will need an __LP64__ ifdef when ILP32 support
42 goes in. See _libc_vdso_platform_setup in
43 sysdeps/unix/sysv/linux/aarch64/init-first.c. */
44
45# undef INIT_ARCH
46# define INIT_ARCH() \
47 PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); \
48 void *vdso_gettimeofday = \
49 _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version);
50
51libc_ifunc_hidden (__redirect___gettimeofday, __gettimeofday,
52 vdso_gettimeofday ?: (void *) __gettimeofday_vsyscall)
53
54__hidden_ver1 (__gettimeofday_vsyscall, __GI___gettimeofday,
55 __gettimeofday_vsyscall);
56
57#else
58
59# include <sys/time.h>
60# include <sysdep.h>
61int
62__gettimeofday (struct timeval *tv, struct timezone *tz)
63{
64 return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
65}
66libc_hidden_def (__gettimeofday)
67
68#endif
69
70weak_alias (__gettimeofday, gettimeofday)
71libc_hidden_weak (gettimeofday)
72

Warning: That file was not part of the compilation database. It may have many parsing errors.