Blame rt/clock-compat.c

Packit Bot 0c2104
/* ABI compatibility redirects for clock_* symbols in librt.
Packit Bot 0c2104
   Copyright (C) 2012-2018 Free Software Foundation, Inc.
Packit Bot 0c2104
   This file is part of the GNU C Library.
Packit Bot 0c2104
Packit Bot 0c2104
   The GNU C Library is free software; you can redistribute it and/or
Packit Bot 0c2104
   modify it under the terms of the GNU Lesser General Public
Packit Bot 0c2104
   License as published by the Free Software Foundation; either
Packit Bot 0c2104
   version 2.1 of the License, or (at your option) any later version.
Packit Bot 0c2104
Packit Bot 0c2104
   The GNU C Library is distributed in the hope that it will be useful,
Packit Bot 0c2104
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 0c2104
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Bot 0c2104
   Lesser General Public License for more details.
Packit Bot 0c2104
Packit Bot 0c2104
   You should have received a copy of the GNU Lesser General Public
Packit Bot 0c2104
   License along with the GNU C Library; if not, see
Packit Bot 0c2104
   <http://www.gnu.org/licenses/>.  */
Packit Bot 0c2104
Packit Bot 0c2104
#include <shlib-compat.h>
Packit Bot 0c2104
Packit Bot 0c2104
/* The clock_* symbols were originally defined in librt and so
Packit Bot 0c2104
   are part of its ABI.  As of 2.17, they have moved to libc.
Packit Bot 0c2104
   So we supply definitions for librt that just redirect to
Packit Bot 0c2104
   their libc counterparts.  */
Packit Bot 0c2104
Packit Bot 0c2104
#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17)
Packit Bot 0c2104
Packit Bot 0c2104
#include <time.h>
Packit Bot 0c2104
Packit Bot 0c2104
#if HAVE_IFUNC
Packit Bot 0c2104
# undef INIT_ARCH
Packit Bot 0c2104
# define INIT_ARCH()
Packit Bot 0c2104
# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name)
Packit Bot 0c2104
#else
Packit Bot 0c2104
# define COMPAT_REDIRECT(name, proto, arglist)				      \
Packit Bot 0c2104
  int									      \
Packit Bot 0c2104
  name proto								      \
Packit Bot 0c2104
  {									      \
Packit Bot 0c2104
    return __##name arglist;						      \
Packit Bot 0c2104
  }
Packit Bot 0c2104
#endif
Packit Bot 0c2104
Packit Bot 0c2104
COMPAT_REDIRECT (clock_getres,
Packit Bot 0c2104
		 (clockid_t clock_id, struct timespec *res),
Packit Bot 0c2104
		 (clock_id, res))
Packit Bot 0c2104
COMPAT_REDIRECT (clock_gettime,
Packit Bot 0c2104
		 (clockid_t clock_id, struct timespec *tp),
Packit Bot 0c2104
		 (clock_id, tp))
Packit Bot 0c2104
COMPAT_REDIRECT (clock_settime,
Packit Bot 0c2104
		 (clockid_t clock_id, const struct timespec *tp),
Packit Bot 0c2104
		 (clock_id, tp))
Packit Bot 0c2104
COMPAT_REDIRECT (clock_getcpuclockid,
Packit Bot 0c2104
		 (pid_t pid, clockid_t *clock_id),
Packit Bot 0c2104
		 (pid, clock_id))
Packit Bot 0c2104
COMPAT_REDIRECT (clock_nanosleep,
Packit Bot 0c2104
		 (clockid_t clock_id, int flags,
Packit Bot 0c2104
		  const struct timespec *req,
Packit Bot 0c2104
		  struct timespec *rem),
Packit Bot 0c2104
		 (clock_id, flags, req, rem))
Packit Bot 0c2104
Packit Bot 0c2104
#endif