Blame rt/clock-compat.c

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