1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

sysv/alpha: Use generic __timeval32 and helpers

Now there is a generic __timeval32 and helpers we can use them for Alpha
instead of the Alpha specific ones.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Alistair Francis
2020-02-11 13:16:14 -08:00
parent 600f00b747
commit 0bcd0c5100
10 changed files with 67 additions and 162 deletions

View File

@ -20,19 +20,20 @@
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
#include <time.h>
#include <sys/time.h>
#include <alpha-tv32-compat.h>
#include <tv32-compat.h>
int
attribute_compat_text_section
__setitimer_tv32 (int which, const struct itimerval32 *restrict new_value,
struct itimerval32 *restrict old_value)
__setitimer_tv32 (int which, const struct __itimerval32 *restrict new_value,
struct __itimerval32 *restrict old_value)
{
struct itimerval new_value_64;
new_value_64.it_interval
= alpha_valid_timeval32_to_timeval (new_value->it_interval);
= valid_timeval32_to_timeval (new_value->it_interval);
new_value_64.it_value
= alpha_valid_timeval32_to_timeval (new_value->it_value);
= valid_timeval32_to_timeval (new_value->it_value);
if (old_value == NULL)
return __setitimer (which, &new_value_64, NULL);
@ -43,9 +44,9 @@ __setitimer_tv32 (int which, const struct itimerval32 *restrict new_value,
/* Write all fields of 'old_value' regardless of overflow. */
old_value->it_interval
= alpha_valid_timeval_to_timeval32 (old_value_64.it_interval);
= valid_timeval_to_timeval32 (old_value_64.it_interval);
old_value->it_value
= alpha_valid_timeval_to_timeval32 (old_value_64.it_value);
= valid_timeval_to_timeval32 (old_value_64.it_value);
return 0;
}