From 691eeb86d45d152f28133617c9de6337542bdbb4 Mon Sep 17 00:00:00 2001 From: jkim Date: Wed, 18 Apr 2007 18:08:12 +0000 Subject: Implement settimeofday() for Linuxulator/amd64. Submitted by: Scot Hetzel (swhetzel at gmail dot com) --- sys/amd64/linux32/linux32_dummy.c | 1 - sys/amd64/linux32/linux32_machdep.c | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index 5f4b797..43d4573 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -64,7 +64,6 @@ DUMMY(pivot_root); DUMMY(mincore); DUMMY(fadvise64); DUMMY(ptrace); -DUMMY(settimeofday); DUMMY(lookup_dcookie); DUMMY(epoll_create); DUMMY(epoll_ctl); diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index b9edd84..320b5fb 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -1178,6 +1178,33 @@ linux_gettimeofday(struct thread *td, struct linux_gettimeofday_args *uap) } int +linux_settimeofday(struct thread *td, struct linux_settimeofday_args *uap) +{ + l_timeval atv32; + struct timeval atv, *tvp; + struct timezone atz, *tzp; + int error; + + if (uap->tp) { + error = copyin(uap->tp, &atv32, sizeof(atv32)); + if (error) + return (error); + atv.tv_sec = atv32.tv_sec; + atv.tv_usec = atv32.tv_usec; + tvp = &atv; + } else + tvp = NULL; + if (uap->tzp) { + error = copyin(uap->tzp, &atz, sizeof(atz)); + if (error) + return (error); + tzp = &atz; + } else + tzp = NULL; + return (kern_settimeofday(td, tvp, tzp)); +} + +int linux_getrusage(struct thread *td, struct linux_getrusage_args *uap) { struct l_rusage s32; -- cgit v1.1