rstat_timeval: Different type from timeval on 64-bit platforms

Xin LI delphij at frontfree.net
Thu Jan 20 07:14:23 PST 2005


Dear folks,

During my recent overhaul of our code I found that rstat_timeval
(defined in include/rpcsvc/rstat.h) did the following:

%%%
struct rstat_timeval {
	u_int tv_sec;
	u_int tv_usec;
};
%%%

While we have timeval defined as:

%%%
struct timeval {
	long	tv_sec;
	suseconds_t	tv_usec;
};
%%%

And we have some potentially incorrect code, which directly cast
rstat_timeval* into timeval*, which will finally cause some wasted data
overwritten on other places.

Is there any reason rstat_timeval is not an alias of timeval?  Is this
for backward compatibility or inter-operation with other operating
systems?

Thanks in advance!

Cheers,
-- 
Xin LI <delphij delphij net>  http://www.delphij.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: 
	=?UTF-8?Q?=E8=BF=99=E6=98=AF=E4=BF=A1=E4=BB=B6=E7=9A=84=E6=95=B0?=
	=?UTF-8?Q?=E5=AD=97=E7=AD=BE=E5=90=8D=E9=83=A8?= =?UTF-8?Q?=E5=88=86?=
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20050120/10d3f795/attachment.bin


More information about the freebsd-hackers mailing list