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 <protocols/timed.h> 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 <sys/time.h> 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 <[EMAIL PROTECTED]> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message