From owner-freebsd-hackers Mon Nov 19 16:51:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by hub.freebsd.org (Postfix) with ESMTP id B636937B418 for ; Mon, 19 Nov 2001 16:51:39 -0800 (PST) Received: (qmail 1949 invoked from network); 20 Nov 2001 00:51:39 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 20 Nov 2001 00:51:39 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011120003613.GA29465@student.uu.se> Date: Mon, 19 Nov 2001 16:51:29 -0800 (PST) From: John Baldwin To: Erik Trulsson Subject: Re: Ok, who broke timed? Cc: hackers@FreeBSD.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 20-Nov-01 Erik Trulsson wrote: > On Mon, Nov 19, 2001 at 03:06:28PM -0800, John Baldwin wrote: >> Does timed have some major 64 bit issues or something? Trying to run timed >> on >> my 5.0 alpha from a 4.4 x86 box proves disastrous. 5.0 x86 clients work >> fine. >> The alpha keeps getting its date set back into 1970: > > After quick look at the source I would say that timed has some major 64 > bit issues. > As far as I can tell timed sends/receives a 'struct tsp' after > adjusting it for byteorder but not for wordsize. This struct is > defined in as > > struct tsp { > u_char tsp_type; > u_char tsp_vers; > u_short tsp_seq; > union { > struct timeval tspu_time; > char tspu_hopcnt; > } tsp_u; > char tsp_name[MAXHOSTNAMELEN]; > }; > > and struct timeval is defined in as > > struct timeval { > long tv_sec; /* seconds */ > long tv_usec; /* and microseconds */ > }; That looks very promising indeed. Hrmm. I should go see if NetBSD has fixed this. I guess having timeval be different sizes on different archs is a bit of a pain. :( Perhaps it should use uint32_t? Or perhaps struct tsp should use its own variant of timeval with uint32_t or some such. Ugh. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message