12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include <errno.h>
- #include <stdlib.h>
- #include <time.h>
- #include <sysdep.h>
- #include <bits/kernel-features.h>
- #include "kernel-posix-timers.h"
- #ifdef __NR_timer_settime
- # ifndef __ASSUME_POSIX_TIMERS
- static int compat_timer_settime (timer_t timerid, int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue);
- # define timer_settime static compat_timer_settime
- # include <nptl/sysdeps/pthread/timer_settime.c>
- # undef timer_settime
- # endif
- # ifdef timer_settime_alias
- # define timer_settime timer_settime_alias
- # endif
- int
- timer_settime (
- timer_t timerid,
- int flags,
- const struct itimerspec *value,
- struct itimerspec *ovalue)
- {
- # undef timer_settime
- # ifndef __ASSUME_POSIX_TIMERS
- if (__no_posix_timers >= 0)
- # endif
- {
- struct timer *kt = (struct timer *) timerid;
-
- int res = INLINE_SYSCALL (timer_settime, 4, kt->ktimerid, flags,
- value, ovalue);
- # ifndef __ASSUME_POSIX_TIMERS
- if (res != -1 || errno != ENOSYS)
- {
-
- __no_posix_timers = 1;
- # endif
- return res;
- # ifndef __ASSUME_POSIX_TIMERS
- }
- # endif
- # ifndef __ASSUME_POSIX_TIMERS
- __no_posix_timers = -1;
- # endif
- }
- # ifndef __ASSUME_POSIX_TIMERS
- return compat_timer_settime (timerid, flags, value, ovalue);
- # endif
- }
- #else
- # ifdef timer_settime_alias
- # define timer_settime timer_settime_alias
- # endif
- # include <nptl/sysdeps/pthread/timer_settime.c>
- #endif
|