From owner-freebsd-standards@FreeBSD.ORG Wed Jul 30 21:52:53 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D54FE37B404; Wed, 30 Jul 2003 21:52:53 -0700 (PDT) Received: from mailman.research.att.com (H-135-207-24-32.research.att.com [135.207.24.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E42243FBD; Wed, 30 Jul 2003 21:52:52 -0700 (PDT) (envelope-from fenner@research.att.com) Received: from unixmail.research.att.com (unixmail.research.att.com [135.207.26.71])h6V4iQ3j006782; Thu, 31 Jul 2003 00:44:26 -0400 Received: from windsor.research.att.com (windsor.research.att.com [135.207.26.46])h6V4qLXs026233; Thu, 31 Jul 2003 00:52:21 -0400 (EDT) From: Bill Fenner Received: (from fenner@localhost) by windsor.research.att.com (8.11.6+Sun/8.8.5) id h6V4qn402047; Wed, 30 Jul 2003 21:52:49 -0700 (PDT) Message-Id: <200307310452.h6V4qn402047@windsor.research.att.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: kris@obsecurity.org References: <20030615053705.GA15421@rot13.obsecurity.org> <20030729000206.GA92727@rot13.obsecurity.org> <20030728234338.B94307@espresso.q9media.com> <20030729042506.GA61736@rot13.obsecurity.org> Date: Wed, 30 Jul 2003 21:52:48 -0700 Versions: dmail (solaris) 2.5a/makemail 2.9d cc: standards@freebsd.org Subject: Re: struct timeval X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2003 04:52:54 -0000 I think we can do this with old-binary-on-new-kernel compatability, by putting in explicit padding that can be zeroed by the kernel. new-binary-on-old-kernel should also work, since the explicit padding in the struct can put the time_t in the right place. My strawman is something like: struct timeval { #ifdef __sparc64__ uint32_t __pad; #endif time_t tv_sec; #ifdef __alpha__ uint32_t __pad; #endif suseconds_t tv_usec; } and anything that returns a timeval has to #if defined(__sparc64__) || defined(__alpha__) tv->__pad = 0; #endif POSIX 1003.1-2001 says: sys/time.h - time types #include The header shall define the timeval structure that includes at least the following members: time_t tv_sec Seconds. suseconds_t tv_usec Microseconds. so the optional padding is OK and the type of tv_sec is correct. Bill