Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Nov 2005 10:23:43 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        current@freebsd.org
Subject:   struct timeval tv_sec type mismatch ?
Message-ID:  <20051112102343.A4222@xorpc.icir.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051112102343.A4222>