Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Wessels, Hans" <H.Wessels@energie-delfland.nl>
To: "'axp-list@redhat.com'" <axp-list@redhat.com>
Subject: RE: Converting time (since 01-01-1970) to Epoch
Date: Wed, 19 May 1999 11:54:52 +0200	[thread overview]
Message-ID: <c=US%a=_%p=delfland%l=MSMAIL-990519095452Z-2396@msmail.energie-delfland.nl> (raw)

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!
   \|   \/\/\/   |/      


             reply	other threads:[~1999-05-19 10:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-19  9:54 Wessels, Hans [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-05-20  0:14 Converting time (since 01-01-1970) to Epoch Tom King
1999-05-19  8:57 Paul Jakma
1999-05-18 14:16 Franco Tassone
1999-05-18 15:18 ` Phil Carmody
1999-05-18 13:27 Paul Jakma
1999-05-18 12:20 Franco Tassone
1999-05-18 16:13 ` Michal Jaegermann
     [not found]   ` <michal@ellpspace.math.ualberta.ca>
1999-05-19  9:51     ` Franco Tassone
1999-05-19  9:23       ` Dr . David Alan Gilbert
1999-05-19  9:33       ` Phil Carmody
1999-05-20  4:06       ` Huw Davies
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox