Add 32bit version of futimes so untar doesn't result in bad dates

(Jan 1, 1970) when run on amd64.

Reviewed by:	ps
This commit is contained in:
ambrisko 2005-12-08 22:14:25 +00:00
parent 88baff4d5f
commit 8cf667cb0b
2 changed files with 24 additions and 1 deletions

View File

@ -1220,6 +1220,28 @@ freebsd32_utimes(struct thread *td, struct freebsd32_utimes_args *uap)
return (kern_utimes(td, uap->path, UIO_USERSPACE, sp, UIO_SYSSPACE));
}
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)
{

View File

@ -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, \