1 /* ABI compatibility redirects for clock_* symbols in librt.
2 Copyright (C) 2012-2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 #include <shlib-compat.h>
21 /* The clock_* symbols were originally defined in librt and so
22 are part of its ABI. As of 2.17, they have moved to libc.
23 So we supply definitions for librt that just redirect to
24 their libc counterparts. */
26 #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
33 # define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \
34 compat_symbol (librt, name, name, GLIBC_2_2);
36 # define COMPAT_REDIRECT(name, proto, arglist) \
40 return __##name arglist; \
42 compat_symbol (librt, name, name, GLIBC_2_2);
45 COMPAT_REDIRECT (clock_getres
,
46 (clockid_t clock_id
, struct timespec
*res
),
48 COMPAT_REDIRECT (clock_gettime
,
49 (clockid_t clock_id
, struct timespec
*tp
),
51 COMPAT_REDIRECT (clock_settime
,
52 (clockid_t clock_id
, const struct timespec
*tp
),
54 COMPAT_REDIRECT (clock_getcpuclockid
,
55 (pid_t pid
, clockid_t
*clock_id
),
57 COMPAT_REDIRECT (clock_nanosleep
,
58 (clockid_t clock_id
, int flags
,
59 const struct timespec
*req
,
60 struct timespec
*rem
),
61 (clock_id
, flags
, req
, rem
))