From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 7 18:17:51 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97E0116A41F for ; Fri, 7 Oct 2005 18:17:51 +0000 (GMT) (envelope-from andreas.kohn@gmx.net) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id CDF7C43D46 for ; Fri, 7 Oct 2005 18:17:47 +0000 (GMT) (envelope-from andreas.kohn@gmx.net) Received: (qmail invoked by alias); 07 Oct 2005 18:17:46 -0000 Received: from unknown (EHLO klamath) [212.204.44.203] by mail.gmx.net (mp008) with SMTP; 07 Oct 2005 20:17:46 +0200 X-Authenticated: #2431876 From: Andreas Kohn To: Brooks Davis In-Reply-To: <20051007162846.GB12691@odin.ac.hmc.edu> References: <1128644542.1273.36.camel@klamath.syndrom23.de> <20051007162846.GB12691@odin.ac.hmc.edu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-OiADRL+wJFCq+DldCtIt" Date: Fri, 07 Oct 2005 20:17:43 +0200 Message-Id: <1128709063.1022.9.camel@klamath.syndrom23.de> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 FreeBSD GNOME Team Port X-Y-GMX-Trusted: 0 Cc: freebsd-hackers@freebsd.org Subject: Re: struct timeval: why is tv_sec long? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2005 18:17:51 -0000 --=-OiADRL+wJFCq+DldCtIt Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, On Fri, 2005-10-07 at 09:28 -0700, Brooks Davis wrote: > On Fri, Oct 07, 2005 at 02:22:22AM +0200, Andreas Kohn wrote: > > Hi, > >=20 > > is there any special reason for timeval.tv_sec being long? >=20 > tv_sec is presumably long becuase that way 64-bit platforms end up with > timevals that don't suffer from the 2038 bug. time_t is also long (or > rather synonimous with it) on all but alpha platforms. Thanks for this explanation. As SUSv2 wants tv_sec to be time_t[1], would it be possible to change this to time_t on all but alpha? I guess alpha will not receive a switch to long anymore[2].=20 This would still require workarounds as you suggested below for alpha (nothing changes here), but would at least bring !alpha closer to standards compliance, which would be a good thing IMVHO. > > and this fails to compile on FreeBSD.=20 >=20 > You probably can just cast the tv.tv_sec to a time_t. Alternativly, you > could allocate a time_t and assing tv_sec to it since that will work on > alpha where the other won't. Yep, I did the latter, and it works. Thanks. Regards, Andreas [1] http://www.opengroup.org/onlinepubs/007908799/xsh/systime.h.html [2] I read the instructions for sparc64, it that looked ugly and difficult.=20 --=20 was macht man eigentlich auf einer linux-gamer lan ? hl server aufsetzen und freuen ? *duck* ^^ --=-OiADRL+wJFCq+DldCtIt Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQBDRrvHYucd7Ow1ygwRAjzQAJ40QsZ6hvdiUH7EwfOVR5DbgUJscACeNasm a1xfXIuUukYjSeCFrYq/g3c= =Cxa4 -----END PGP SIGNATURE----- --=-OiADRL+wJFCq+DldCtIt--