From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 28882 invoked from network); 19 May 1999 10:34:03 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 19 May 1999 10:34:03 -0000 Received: from yalta.NL.net (yalta.NL.net [193.67.79.154]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA03213 for ; Wed, 19 May 1999 05:55:12 -0400 Received: from [195.193.204.42] ([195.193.204.42]:18693 "HELO msmail.energie-delfland.nl" ident: "NO-IDENT-SERVICE[2]") by yalta.NL.net with SMTP id <13382-28662>; Wed, 19 May 1999 11:55:01 +0200 Received: by msmail.energie-delfland.nl with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.996.62) id <01BEA1EE.68100000@msmail.energie-delfland.nl>; Wed, 19 May 1999 11:54:53 +0200 Message-ID: From: "Wessels, Hans" To: "'axp-list@redhat.com'" Subject: RE: Converting time (since 01-01-1970) to Epoch Date: Wed, 19 May 1999 11:54:52 +0200 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.996.62 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Franco, >I have a binary file with record fixed lenght, it has been written on an SGI >box (Irix 6.2) using the following structure: > >(/usr/include/rpcsvc/rusers.h) > >struct rusers_utmp { > char ut_line[8]; /* tty name */ > char ut_name[8]; /* user id */ > char ut_host[16]; /* host name, if remote */ > long ut_time; /* time on */ >}; > >For the SGI box, sizeof(long) = 4. > > >So I've converted the file, rewriting all the records on an Alpha-Linux box >(kernel 2.2.7) using the following structure: > >(/usr/include/rpcsvc/rusers.h) > >struct ru_utmp { > char ut_line[8]; /* tty name */ > char ut_name[8]; /* user id */ > char ut_host[16]; /* host name, if remote */ > long ut_time; /* time on */ >}; > >For Alpha-Linux box, sizeof(long) = 8. >My conversion program does only a field's level assignments, and rewrites the >new file, due to different sizeof(long). >The resulting dates (ut_time in ru_utmp) are all garbled. >Any ideas ? Is there maybe a big-little endian problem here? Alpha is little endian, but I am not sure about the SGI box. Hans ---------------------------------------------------------------------- /| /\/\/\ |\ ir. Hans Wessels / | / /\/\ \ | \ H.Wessels@Energie-Delfland.nl / | / / /\ \ \ | \ tel.: 015 251 4397 / |/ / / \ \ \| \ \ |\ \ \ / / /| / prive: \ | \ \ \/ / / | / mr_ni@mbh.org \ | \ \/\/ / | / Fidelus Bittus et Fuckus Clockcyclus! \| \/\/\/ |/