]>
Commit | Line | Data |
---|---|---|
ca677d3c | 1 | /* Initialization code run first thing by the ELF startup code. Linux/i386. |
04277e02 | 2 | Copyright (C) 2015-2019 Free Software Foundation, Inc. |
ca677d3c AZ |
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 | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the 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 | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
ca677d3c | 18 | |
15b8d67e RÁE |
19 | #include <time.h> |
20 | #include <sysdep.h> | |
21 | #include <dl-vdso.h> | |
22 | #include <sysdep-vdso.h> | |
ca677d3c | 23 | |
f534255e | 24 | long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *) |
ea02c6b8 | 25 | attribute_hidden; |
ca677d3c AZ |
26 | |
27 | static long int | |
28 | clock_gettime_syscall (clockid_t id, struct timespec *tp) | |
29 | { | |
30 | INTERNAL_SYSCALL_DECL (err); | |
31 | return INTERNAL_SYSCALL (clock_gettime, err, 2, id, tp); | |
32 | } | |
33 | ||
34 | static inline void | |
35 | __vdso_platform_setup (void) | |
36 | { | |
b8386c28 | 37 | void *p = get_vdso_symbol ("__vdso_clock_gettime"); |
ca677d3c AZ |
38 | if (p == NULL) |
39 | p = clock_gettime_syscall; | |
40 | PTR_MANGLE (p); | |
f534255e | 41 | VDSO_SYMBOL (clock_gettime) = p; |
ca677d3c AZ |
42 | } |
43 | ||
15b8d67e | 44 | #define VDSO_SETUP __vdso_platform_setup |
ca677d3c AZ |
45 | |
46 | #include <csu/init-first.c> |