diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2005-12-08 22:14:25 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2005-12-08 22:14:25 +0000 |
commit | 8cf667cb0b5875f637f797417b3d2718821d9988 (patch) | |
tree | fdf6d9d19342e87c9373c8bdeb1de8fc1af9a236 /sys/compat | |
parent | 88baff4d5fa6fa89fa89c5c78bb50bfb4d8d8d19 (diff) | |
download | FreeBSD-src-8cf667cb0b5875f637f797417b3d2718821d9988.zip FreeBSD-src-8cf667cb0b5875f637f797417b3d2718821d9988.tar.gz |
Add 32bit version of futimes so untar doesn't result in bad dates
(Jan 1, 1970) when run on amd64.
Reviewed by: ps
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 22 | ||||
-rw-r--r-- | sys/compat/freebsd32/syscalls.master | 3 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 114c6f4..feb03a5 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1221,6 +1221,28 @@ freebsd32_utimes(struct thread *td, struct freebsd32_utimes_args *uap) } int +freebsd32_futimes(struct thread *td, struct freebsd32_futimes_args *uap) +{ + struct timeval32 s32[2]; + struct timeval s[2], *sp; + int error; + + if (uap->tptr != NULL) { + error = copyin(uap->tptr, s32, sizeof(s32)); + if (error) + return (error); + CP(s32[0], s[0], tv_sec); + CP(s32[0], s[0], tv_usec); + CP(s32[1], s[1], tv_sec); + CP(s32[1], s[1], tv_usec); + sp = s; + } else + sp = NULL; + return (kern_futimes(td, uap->fd, sp, UIO_SYSSPACE)); +} + + +int freebsd32_adjtime(struct thread *td, struct freebsd32_adjtime_args *uap) { struct timeval32 tv32; diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index fc645f2..f94cb83 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -374,7 +374,8 @@ 204 AUE_NULL MNOPROTO { int munlock(const void *addr, \ size_t len); } 205 AUE_NULL MNOPROTO { int undelete(char *path); } -206 AUE_NULL MNOPROTO { int futimes(int fd, struct timeval *tptr); } +206 AUE_NULL MSTD { int freebsd32_futimes(int fd, \ + struct timeval32 *tptr); } 207 AUE_NULL MNOPROTO { int getpgid(pid_t pid); } 208 AUE_NULL UNIMPL newreboot (NetBSD) 209 AUE_NULL MNOPROTO { int poll(struct pollfd *fds, u_int nfds, \ |