From owner-freebsd-current@FreeBSD.ORG Thu Dec 8 19:43:35 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA07316A420 for ; Thu, 8 Dec 2005 19:43:35 +0000 (GMT) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [64.174.51.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 687C543D4C for ; Thu, 8 Dec 2005 19:43:12 +0000 (GMT) (envelope-from ambrisko@ambrisko.com) Received: from server2.ambrisko.com (HELO www.ambrisko.com) ([192.168.1.2]) by mail.ambrisko.com with ESMTP; 08 Dec 2005 11:43:10 -0800 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.11/8.12.9) with ESMTP id jB8Jh9a2045956 for ; Thu, 8 Dec 2005 11:43:09 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.12.11/8.12.11/Submit) id jB8Jh9d0045955 for current@freebsd.org; Thu, 8 Dec 2005 11:43:09 -0800 (PST) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200512081943.jB8Jh9d0045955@ambrisko.com> To: current@freebsd.org Date: Thu, 8 Dec 2005 11:43:09 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Cc: Subject: Patch for FreeBSD 32bit running on 64bit for futimes for review X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2005 19:43:36 -0000 I'm looking for a review of fixing futimes when running on FreeBSD/i386 binary on FreeBSD/amd64. The problem is that tar uses this to set the time on files it is extracting. Without this shim the dates are messed up Jan 1 1970. This breaks a ports build of i386 on amd64 in a i386 chroot. Index: sys/compat/freebsd32/freebsd32_misc.c =================================================================== RCS file: /usr/local/cvsroot/freebsd/src/sys/compat/freebsd32/freebsd32_misc.c,v retrieving revision 1.38.2.1 diff -u -p -r1.38.2.1 freebsd32_misc.c --- sys/compat/freebsd32/freebsd32_misc.c 18 Jul 2005 19:49:48 -0000 1.38.2.1 +++ sys/compat/freebsd32/freebsd32_misc.c 8 Dec 2005 18:26:54 -0000 @@ -846,6 +846,28 @@ freebsd32_utimes(struct thread *td, stru } 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; Index: sys/compat/freebsd32/syscalls.master =================================================================== RCS file: /usr/local/cvsroot/freebsd/src/sys/compat/freebsd32/syscalls.master,v retrieving revision 1.50.2.1 diff -u -p -r1.50.2.1 syscalls.master --- sys/compat/freebsd32/syscalls.master 20 Jul 2005 17:42:15 -0000 1.50.2.1 +++ sys/compat/freebsd32/syscalls.master 8 Dec 2005 18:26:55 -0000 @@ -366,7 +366,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, \ If this is correct, then it looks like I commit this then commit the generated files after. Thanks, Doug A.