https://bugs.winehq.org/show_bug.cgi?id=40865
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Status|UNCONFIRMED |NEW Summary|Steam does not connect to |Steam does not connect to |internet (gethostbyname_r |internet (gethostbyname_r |does not return ERANGE in |used even when not declared |NetBSD) |in netdb.h) Ever confirmed|0 |1
--- Comment #8 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Adrien Fernandes from comment #7)
http://mail-index.netbsd.org/netbsd-users/2016/06/29/msg018649.html
Thanks. I just saw Christos Zoulas reply but I don't know how to reply to his specific message. I'll quote him here:
==========
gethostbyname_r()/gethostbyaddr_r() are not documented for a reason; they are non-standard. There are at least 3 flavors out there last time I checked, and portable code should not be using them. I implemented them in NetBSD just to use them inside getaddrinfo()/getnameinfo(). I chose not to hide them completely and that was probably a bad decision seeing that some auto-configuration schemes look for functions in libc and then try to use the functions (even when they are no headers describing the functions; I'd really like to know how do they deduce the arguments...) Why doesn't wine use those instead (getaddrinfo()/getnameinfo())?
==========
I believe this is a bug in Wine's side because the function is not present in netdb.h as expected so the configure check does generate a warning (just tested). Maybe we can add -Werror to this specific check (is it possible?) which would ensure the function will not be used when it is linkable but not declared anywhere.
I just looked further about gethostbyname_r and it seems like there is at least one variation where the function returns a struct hostent * instead of an int [1].
So we need to be more careful in this case as it is not only used in winsock but also in kernel32 (bug 40799).
This is major since any network related program will not be usable in NetBSD.
[1] http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/lib_ref/g/gethostbyname...