struct timeval tv_sec type mismatch ?
Luigi Rizzo
rizzo at icir.org
Sat Nov 12 10:23:44 PST 2005
on freebsd 5.x and above, the tv_sec field of struct timeval
has type 'long' (defined here:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/_timeval.h
whereas apparently most platform have it as time_t, and i believe
there are standards that require that:
http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html
Any reason to keep it as a 'long' ?
The differences between these two types prevents from passing
&tv.tv_sec to functions requiring a time_t * as arguments, which
is apparently a relatively common practice.
cheers
luigi
More information about the freebsd-current
mailing list