Much time has passed. Oops. :-)
On Sep 22, 2004, at 03:42, Mark Crispin wrote:
On Wed, 22 Sep 2004, Chris Ross wrote:Particularly, tho, I've found a problem that doesn't produce an error.
In tcp_unix.c, getsockname() is called, and the third argument given
to is is a size_t*. However, on NetBSD, it calls for a socklen_t*, which
is a pointer to a 32-bit value, and size_t is a long, and therefore 64 bits.
Sigh. On some systems, it's an int* (and socklen_t is undefined). On some, it's a socklen_t*. And on some, it's a size_t* (and socklen_t is undefined). At UW, we have examples of all three; and there's no good way for the code to know what it is on the system being built. That's why c-client casts it to a void*.
I suggest that the best thing to do is have the NETBSD osdep files redefine getsockname() as a jacket function into the real one. Take a look at the SCO osdep files for an example (e.g. how rename() gets redefined). Of course, that assumes that all NETBSD is 64 bit or at least follows the socklen_t* convention; if not then a new port has to be spawned off.
Okay. I quick look at recent BSD/OS revisions (4.3 and 5.x) shows that
socklen_t is used there. I assume the same is true of OpenBSD, but will
check that. I should investigate FreeBSD, in case it's the same there, too,
and modify bsf as well as bsi.
So, do you suggest I do what the SCO port does, and have a different .c
file with the wrapper function in it, or should I just put it in os_bsi.c? I guess
if both bsi and bsf use it, that answers the question...
- Chris
