From owner-freebsd-sparc64@FreeBSD.ORG Tue Oct 14 08:20:26 2003 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB6F016A4B3; Tue, 14 Oct 2003 08:20:26 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id E092D43F3F; Tue, 14 Oct 2003 08:20:24 -0700 (PDT) (envelope-from schilling@fokus.fraunhofer.de) Received: from burner.fokus.fraunhofer.de (burner [193.175.133.116]) h9EFKLD01393; Tue, 14 Oct 2003 17:20:21 +0200 (MEST) Received: (from jes@localhost)h9EFKCip004956; Tue, 14 Oct 2003 17:20:12 +0200 (CEST) Date: Tue, 14 Oct 2003 17:20:12 +0200 (CEST) From: Joerg Schilling Message-Id: <200310141520.h9EFKCip004956@burner.fokus.fraunhofer.de> To: bde@zeta.org.au, brandt@fokus.fraunhofer.de, schilling@fokus.fraunhofer.de, sparc64@freebsd.org, standards@freebsd.org Subject: Re: time_t on sparc64 (fwd) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2003 15:20:26 -0000 >---------- Forwarded message ---------- >Date: Tue, 14 Oct 2003 04:17:34 +1000 (EST) >From: Bruce Evans >To: Harti Brandt >Cc: standards@freebsd.org, sparc64@freebsd.org >Subject: Re: time_t on sparc64 >On Mon, 13 Oct 2003, Harti Brandt wrote: >> I just discovered that time_t is 32-bit on sparc64. One of the problems >> is that struct timeval is defined by Posix as >> >> struct timeval { >> time_t tv_secs; >> suseconds_t tv_usecs; >> }; >This is a bug in POSIX. In BSD, tv_secs has type long which may be, >and is different from time_t. No, it is definitely not a POSIX bug. POSIX is consistent and doesn't need to be fixed. FreeBSD is inconsistent. You cannot call e.g. ctime(&t.tv_sec) >> but _timeval.h has >> >> struct timeval { >> long tv_secs; >> suseconds_t tv_usecs; >> } >> >> This means, that our timeval is not Posix compatible. What is the reason >> for time_t not beeing a long on sparc64? >time_t was used in some data structures whose layout shouldn't be changed >even for new arches. Mainly in ufs in Lite2: >%%% >ffs/fs.h: time_t fs_time; /* last time written */ >ffs/fs.h: time_t cg_time; /* time last written */ This looks like an internal implementation problem of the FreeBSD kernel. This is definitely bejond the scope of a standard. Please note that introducing an inconsistent user interface is much harder to fix later than adding a few hacks into the kernel and fix the real kernel problem later. You have nearly 35 years left.... Jörg -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) If you don't have iso-8859-1 schilling@fokus.fraunhofer.de (work) chars I am J"org Schilling URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily