2020-09-02 19:49:04 +00:00
|
|
|
diff --git a/src/libfaketime.c b/src/libfaketime.c
|
2022-01-27 00:06:31 +00:00
|
|
|
index 18e2c94..363f38c 100644
|
2020-09-02 19:49:04 +00:00
|
|
|
--- a/src/libfaketime.c
|
|
|
|
+++ b/src/libfaketime.c
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -1936,6 +1936,7 @@ timer_settime_common(timer_t_or_int timerid, int flags,
|
2020-09-02 19:49:04 +00:00
|
|
|
/*
|
|
|
|
* Faked timer_settime() compatible with implementation in GLIBC 2.2
|
|
|
|
*/
|
|
|
|
+__attribute__ ((symver ("timer_settime@GLIBC_2.2")))
|
|
|
|
int timer_settime_22(int timerid, int flags,
|
|
|
|
const struct itimerspec *new_value,
|
|
|
|
struct itimerspec *old_value)
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -1958,6 +1959,7 @@ int timer_settime_22(int timerid, int flags,
|
2020-09-02 19:49:04 +00:00
|
|
|
/*
|
|
|
|
* Faked timer_settime() compatible with implementation in GLIBC 2.3.3
|
|
|
|
*/
|
|
|
|
+__attribute__ ((symver ("timer_settime@@GLIBC_2.3.3")))
|
|
|
|
int timer_settime_233(timer_t timerid, int flags,
|
|
|
|
const struct itimerspec *new_value,
|
|
|
|
struct itimerspec *old_value)
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -2031,6 +2033,7 @@ int timer_gettime_common(timer_t_or_int timerid, struct itimerspec *curr_value,
|
2020-09-02 19:49:04 +00:00
|
|
|
/*
|
|
|
|
* Faked timer_gettime() compatible with implementation in GLIBC 2.2
|
|
|
|
*/
|
|
|
|
+__attribute__ ((symver ("timer_gettime@GLIBC_2.2")))
|
|
|
|
int timer_gettime_22(timer_t timerid, struct itimerspec *curr_value)
|
|
|
|
{
|
|
|
|
if (!initialized)
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -2051,6 +2054,7 @@ int timer_gettime_22(timer_t timerid, struct itimerspec *curr_value)
|
2020-09-02 19:49:04 +00:00
|
|
|
/*
|
|
|
|
* Faked timer_gettime() compatible with implementation in GLIBC 2.3.3
|
|
|
|
*/
|
|
|
|
+__attribute__ ((symver ("timer_gettime@@GLIBC_2.3.3")))
|
|
|
|
int timer_gettime_233(timer_t timerid, struct itimerspec *curr_value)
|
|
|
|
{
|
|
|
|
if (!initialized)
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -2068,10 +2072,6 @@ int timer_gettime_233(timer_t timerid, struct itimerspec *curr_value)
|
2020-09-02 19:49:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-__asm__(".symver timer_gettime_22, timer_gettime@GLIBC_2.2");
|
|
|
|
-__asm__(".symver timer_gettime_233, timer_gettime@@GLIBC_2.3.3");
|
|
|
|
-__asm__(".symver timer_settime_22, timer_settime@GLIBC_2.2");
|
|
|
|
-__asm__(".symver timer_settime_233, timer_settime@@GLIBC_2.3.3");
|
|
|
|
|
2022-01-27 00:06:31 +00:00
|
|
|
#ifdef __linux__
|
|
|
|
/*
|
|
|
|
@@ -3463,6 +3463,11 @@ struct pthread_cond_monotonic {
|
2020-09-02 19:49:04 +00:00
|
|
|
|
|
|
|
static struct pthread_cond_monotonic *monotonic_conds = NULL;
|
|
|
|
|
|
|
|
+#if defined __ARM_ARCH || defined FORCE_PTHREAD_NONVER
|
|
|
|
+__attribute__ ((symver ("pthread_cond_init@@")))
|
|
|
|
+#else
|
|
|
|
+__attribute__ ((symver ("pthread_cond_init@@GLIBC_2.3.2")))
|
|
|
|
+#endif
|
|
|
|
int pthread_cond_init_232(pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr)
|
|
|
|
{
|
|
|
|
clockid_t clock_id;
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -3501,6 +3506,11 @@ int pthread_cond_init_232(pthread_cond_t *restrict cond, const pthread_condattr_
|
2020-09-02 19:49:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if defined __ARM_ARCH || defined FORCE_PTHREAD_NONVER
|
|
|
|
+__attribute__ ((symver ("pthread_cond_destroy@@")))
|
|
|
|
+#else
|
|
|
|
+__attribute__ ((symver ("pthread_cond_destroy@@GLIBC_2.3.2")))
|
|
|
|
+#endif
|
|
|
|
int pthread_cond_destroy_232(pthread_cond_t *cond)
|
|
|
|
{
|
|
|
|
struct pthread_cond_monotonic* e;
|
2022-01-27 00:06:31 +00:00
|
|
|
@@ -3608,26 +3618,22 @@ int pthread_cond_timedwait_common(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
2020-09-02 19:49:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
+__attribute__ ((symver ("pthread_cond_timedwait@GLIBC_2.2.5")))
|
|
|
|
int pthread_cond_timedwait_225(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
|
|
|
|
{
|
|
|
|
return pthread_cond_timedwait_common(cond, mutex, abstime, FT_COMPAT_GLIBC_2_2_5);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if defined __ARM_ARCH || defined FORCE_PTHREAD_NONVER
|
|
|
|
+__attribute__ ((symver ("pthread_cond_timedwait@@")))
|
|
|
|
+#else
|
|
|
|
+__attribute__ ((symver ("pthread_cond_timedwait@@GLIBC_2.3.2")))
|
|
|
|
+#endif
|
|
|
|
int pthread_cond_timedwait_232(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
|
|
|
|
{
|
|
|
|
return pthread_cond_timedwait_common(cond, mutex, abstime, FT_COMPAT_GLIBC_2_3_2);
|
|
|
|
}
|
|
|
|
|
|
|
|
-__asm__(".symver pthread_cond_timedwait_225, pthread_cond_timedwait@GLIBC_2.2.5");
|
|
|
|
-#if defined __ARM_ARCH || defined FORCE_PTHREAD_NONVER
|
|
|
|
-__asm__(".symver pthread_cond_timedwait_232, pthread_cond_timedwait@@");
|
|
|
|
-__asm__(".symver pthread_cond_init_232, pthread_cond_init@@");
|
|
|
|
-__asm__(".symver pthread_cond_destroy_232, pthread_cond_destroy@@");
|
|
|
|
-#else
|
|
|
|
-__asm__(".symver pthread_cond_timedwait_232, pthread_cond_timedwait@@GLIBC_2.3.2");
|
|
|
|
-__asm__(".symver pthread_cond_init_232, pthread_cond_init@@GLIBC_2.3.2");
|
|
|
|
-__asm__(".symver pthread_cond_destroy_232, pthread_cond_destroy@@GLIBC_2.3.2");
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|