[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libvirt] [PATCH libvirt 6/6] Cast timeval.tv_sec long to localtime

From: Bruno Haible
Subject: Re: [libvirt] [PATCH libvirt 6/6] Cast timeval.tv_sec long to localtime expected type time_t
Date: Sat, 28 Jan 2012 03:51:40 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Marc-André Lureau wrote:
> >>> Oops.  struct timeval is generating a struct timeval with a 32-bit
> >>> tv_sec even when time_t is 64-bits.
> ...
> Mingw64 reviewer said Windows actually defines it. I dig the msdn and
> found this:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms740560(v=vs.85).aspx
> I suppose they are correct, and they should follow what Windows uses.
> The problem was reported in an msdn discussion too:
> http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/674d34c9-b6f6-4380-bc7b-181eae99847a

Thanks for the deeper investigation. Indeed, 'struct timeval' is defined
by the Winsock2 API, and used by the functions GetAddrInfoEx, SetAddrInfoEx,
WSAConnectByList, WSAConnectByName, select. mingw64 cannot easily change
this struct.

> Should gnulib redefine this struct similarly to other incompatible types?

Yes, this will make sense. As far as I can see, it's a manageable task:
Only the replacements of <sys/time.h>, <sys/select.h>, select(),
gettimeofday(), getsockopt(), setsockopt() will need work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]