curl-library
Re: Solaris 10 autobuild and recvfrom() sixth argument data type
From: Jamie Lokier <jamie_at_shareable.org>
Date: Mon, 21 Jul 2008 15:17:20 +0100
Date: Mon, 21 Jul 2008 15:17:20 +0100
Yang Tse wrote:
> But even on Solaris, I find it quite strange that the 'real' prototype
> has a void pointer for the 'fromlen' sixth argument.
It's probably so it can compile applications that use 'socklen_t' and
applications that use 'int', and those which use 'size_t' for
historical reasons (the reason 'socklen_t' was created).
Because 'socklen_t' and 'size_t' are unsigned, and 'int' is signed,
the only compatible prototype is 'void *'.
Provided the type sizes are the same, there's no problem since the
values are always small and positive.
-- Jamie
Received on 2008-07-21