Blame rt/clock-compat.c

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