Blame rt/clock-compat.c

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