diff options
author | Doug Ambrisko <ambrisko@FreeBSD.org> | 2005-12-08 22:14:25 +0000 |
---|---|---|
committer | Doug Ambrisko <ambrisko@FreeBSD.org> | 2005-12-08 22:14:25 +0000 |
commit | 8e7604db06fc1a6a332d011f312872518787800f (patch) | |
tree | fdf6d9d19342e87c9373c8bdeb1de8fc1af9a236 | |
parent | 0673e800e9558e552fc937f1b5a885e3f8ebf0c3 (diff) | |
download | src-8e7604db06fc1a6a332d011f312872518787800f.tar.gz src-8e7604db06fc1a6a332d011f312872518787800f.zip |
Add 32bit version of futimes so untar doesn't result in bad dates
(Jan 1, 1970) when run on amd64.
Reviewed by: ps
Notes
Notes:
svn path=/head/; revision=153247
-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 114c6f46287e..feb03a52603a 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 fc645f24fab0..f94cb83104ab 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, \ |