Re: Error handling in Win32 + gnulib

2009-12-01 Thread Jim Meyering
Simon Josefsson wrote: > Jim Meyering writes: > >> Richard W.M. Jones wrote: >> ... >>> Unfortunately I was never able to get anyone at Red Hat to sign a >>> copyright assignment license for me for gnulib, or to get the FSF to >>> agree that I didn't need one because I work for Red Hat. >> >> Tha

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Bruno Haible
Richard W.M. Jones wrote: > | Software using gnulib should use errno exclusively, along with > | standard Unix functions such as perror, strerror, etc., which Gnulib > | may replace as necessary so these functions work correctly on > | platforms that lack them (ie. Win32). All Gnulib POSIX replace

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Simon Josefsson
Jim Meyering writes: > Richard W.M. Jones wrote: > ... >> Unfortunately I was never able to get anyone at Red Hat to sign a >> copyright assignment license for me for gnulib, or to get the FSF to >> agree that I didn't need one because I work for Red Hat. > > That is not an issue, since there is

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Paolo Bonzini
On 11/30/2009 10:16 AM, Richard W.M. Jones wrote: My take from this is that we need a 'set_errno' function which is equivalent to 'set_winsock_errno' and is used for all non-socket functions. For all non-socket functions that are mapped to Win32 functions, yes. Here is the list that Wine uses,

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Richard W.M. Jones
On Fri, Nov 27, 2009 at 03:57:13PM +, Richard W.M. Jones wrote: > Win32 itself doesn't use or define a variable called 'errno', but > gnulib does provide this variable when linked to Win32 programs. This statement is inaccurate: Win32 does define errno, but only uses it for some "system level"

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Jim Meyering
Richard W.M. Jones wrote: ... > Unfortunately I was never able to get anyone at Red Hat to sign a > copyright assignment license for me for gnulib, or to get the FSF to > agree that I didn't need one because I work for Red Hat. That is not an issue, since there is a blanket ("ANY") assignment from

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Richard W.M. Jones
On Mon, Nov 30, 2009 at 09:16:04AM +, Richard W.M. Jones wrote: > My take from this is that we need a 'set_errno' function which is Jim pointed out to me that calling it 'set_errno' is likely to be confused with the glibc macro __set_errno. Call it 'win32_set_errno' of whatever instead, but t

Re: Error handling in Win32 + gnulib

2009-11-30 Thread Richard W.M. Jones
It's not been stated in so many words, but from what I gather the policy on errors in Gnulib is as follows. | Software using gnulib should use errno exclusively, along with | standard Unix functions such as perror, strerror, etc., which Gnulib | may replace as necessary so these functions work cor

Re: Error handling in Win32 + gnulib

2009-11-28 Thread Bruno Haible
Richard W.M. Jones wrote: > error codes aren't compatible. > Although Gnulib tries to define its own error numbers which are > compatible with Win32 ones (eg. EINPROGRESS == 10036 == > WSAEINPROGRESS), it also uses some from the MinGW header files which > are just plain wrong (eg. ENOMEM == 12 == E

Re: Error handling in Win32 + gnulib

2009-11-28 Thread Paolo Bonzini
On 11/27/2009 04:57 PM, Richard W.M. Jones wrote: (b) A call to a Winsock socket function that gnulib hasn't replaced: errno won't have any meaningful value and I must call WSAGetLastError. We can add replacements for these. (c) A call to a non-socket Win32 function that gnulib has replaced:

Error handling in Win32 + gnulib

2009-11-27 Thread Richard W.M. Jones
I'm confused by errno and error handling in gnulib, and what the strategy for this is supposed to be, versus how it seems to work now. Win32 has two methods to return an error code from a syscall: DWORD WSAGetLastError(void); // for all socket functions DWORD GetLastError(); // for al