From owner-freebsd-bugs Fri Oct 29 22:59:35 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id A178414CB2 for ; Fri, 29 Oct 1999 22:59:31 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from p148-ts5.syd2.zeta.org.au (beefcake.zeta.org.au [203.26.10.12]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id QAA29273; Sat, 30 Oct 1999 16:03:48 +1000 Date: Sat, 30 Oct 1999 15:59:08 +1000 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Garrett Wollman Cc: jin@george.lbl.gov, freebsd-bugs@FreeBSD.ORG, sheldonh@uunet.co.za Subject: Re: bin/14472: date for Y#K In-Reply-To: <199910292000.QAA96945@khavrinen.lcs.mit.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, 29 Oct 1999, Garrett Wollman wrote: > < > > What happens if we change the definition of _BSD_TIME_T to int64_t? > > Is it a performance issue or may it break an enormous things? > > Filesystems and many system calls break. More details: (1) Fields in ffs's super block and cylinder group block and ufs's disk quota struct that are incorrectly declared as having type time_t will break. These fields must have size 4 octets for binary compatibility with old file systems. (2) Timestamp fields in ufs' dinode struct are declared as having type int32_t to give binary compatibility. These won't break, but they won't actually hold 64-bit time_t's either. (3) I think the breakage of system calls is limited to binary incompatibility, mainly for time_t's in structs. > > "long" seems to be a bad type definition in C program since it is not in > > a fixed variable size. > > As Nate has pointed out, no C type is fixed in size. time_t actually has to have size 32 bits with no padding to avoid breaking filesystems (see (1)). Thus _BSD_TIME_T must not be declared as "long" on alphas; it is actually declared as "int". On i386's, both "int" and "long" nomally have size 32 bits with no padding, so either can be used. "long" is used mainly to avoid exposing bad assumptions that time_t is "long". Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message