cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Solaris 10 autobuild and recvfrom() sixth argument data type

From: Jamie Lokier <jamie_at_shareable.org>
Date: Mon, 21 Jul 2008 19:15:59 +0100

Yang Tse wrote:
> Googling around I have not found a single system which documents a
> recvfrom prototype with a void pointer for the sixth argument.

I would think it wouldn't be documented, because it's only for
technical compatibility in the header file, you're not expected to
*pass* a void* pointer, you're expected to use the function as
though it takes the documented type.

> I don't mind changing it to 'int', even if it is only for historical
> standard reasons, but I think that using a socklen_t, when prototyped
> to void pointer, could generate unexpected problems when using strange
> 64-bit ABIs.

Really? I would think that's the one instance in which socklen_t
would be more likely correct than int. Otherwise why would the system
define socklen_t? But as you say:

> Arggh, I've just remembered the horrible things needed at the end of
> lib/setup.h to cope with a system that has the socklen_t definition
> and seems to have a real problem when using 64-bit ABI with default
> interfaces which don't expect a 64-bit socklen_t but simply a 32-bit
> int.

Gah. Why do they define socklen_t at all, if you're not supposed to use it?

-- Jamie
Received on 2008-07-21