Re: [Q] proper definition of "struct timeval" ?

Andries.Brouwer@cwi.nl
Fri, 7 Mar 1997 23:48:19 +0100


Yui-wah LEE:

: What is the proper type of "struct timeval" ? Seems that linux's
: definition is different to other's ...

>From `man 2 utimes':
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};

: --- other
: +++ linux
: struct timeval {
: - long tv_sec; /* seconds */
: + int tv_sec; /* seconds */
: - long tv_usec; /* and microseconds */
: + int tv_usec; /* and microseconds */
: };

: "other" means ANSI, ultrix, mach etc, "linux" means linux 2.0.18, 2.0.27
: etc (linux's defined in /usr/src/linux/include/linux/time.h, symlinked
: _to_ by /usr/include/linux/time.h )

: Why is that so ?

Looks like a Linux kernel bug - the man page is right,
and `long' is prescribed by SVID.

Andries