linux(4): Implement timer_settime64 syscall.
MFC after: 2 weeks
This commit is contained in:
parent
9038a0b74c
commit
a1fd2911dd
@ -68,7 +68,6 @@ DUMMY(mq_getsetattr);
|
||||
DUMMY(arch_prctl);
|
||||
/* Linux 5.0: */
|
||||
DUMMY(clock_adjtime64);
|
||||
DUMMY(timer_settime64);
|
||||
DUMMY(timerfd_gettime64);
|
||||
DUMMY(timerfd_settime64);
|
||||
DUMMY(io_pgetevents_time64);
|
||||
|
@ -123,21 +123,55 @@ linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap)
|
||||
{
|
||||
struct l_itimerspec l_val, l_oval;
|
||||
struct itimerspec val, oval, *ovalp;
|
||||
int error;
|
||||
int flags, error;
|
||||
|
||||
error = copyin(uap->new, &l_val, sizeof(l_val));
|
||||
if (error != 0)
|
||||
return (error);
|
||||
ITS_CP(l_val, val);
|
||||
error = linux_to_native_itimerspec(&val, &l_val);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
ovalp = uap->old != NULL ? &oval : NULL;
|
||||
error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp);
|
||||
error = linux_to_native_timerflags(&flags, uap->flags);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp);
|
||||
if (error == 0 && uap->old != NULL) {
|
||||
ITS_CP(oval, l_oval);
|
||||
error = native_to_linux_itimerspec(&l_val, &val);
|
||||
if (error == 0)
|
||||
error = copyout(&l_oval, uap->old, sizeof(l_oval));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
|
||||
int
|
||||
linux_timer_settime64(struct thread *td, struct linux_timer_settime64_args *uap)
|
||||
{
|
||||
struct l_itimerspec64 l_val, l_oval;
|
||||
struct itimerspec val, oval, *ovalp;
|
||||
int flags, error;
|
||||
|
||||
error = copyin(uap->new, &l_val, sizeof(l_val));
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = linux_to_native_itimerspec64(&val, &l_val);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
ovalp = uap->old != NULL ? &oval : NULL;
|
||||
error = linux_to_native_timerflags(&flags, uap->flags);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = kern_ktimer_settime(td, uap->timerid, flags, &val, ovalp);
|
||||
if (error == 0 && uap->old != NULL) {
|
||||
error = native_to_linux_itimerspec64(&l_val, &val);
|
||||
if (error == 0)
|
||||
error = copyout(&l_oval, uap->old, sizeof(l_oval));
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *uap)
|
||||
{
|
||||
|
@ -70,7 +70,6 @@ DUMMY(vm86old);
|
||||
DUMMY(arch_prctl);
|
||||
/* Linux 5.0: */
|
||||
DUMMY(clock_adjtime64);
|
||||
DUMMY(timer_settime64);
|
||||
DUMMY(timerfd_gettime64);
|
||||
DUMMY(timerfd_settime64);
|
||||
DUMMY(io_pgetevents_time64);
|
||||
|
Loading…
Reference in New Issue
Block a user