cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Tor Arntsen <tor_at_spacetec.no>
Date: Mon, 21 Jul 2008 15:05:11 +0200

On Sun, Jul 20, 2008 at 11:39 PM, Yang Tse <yangsita_at_gmail.com> wrote:
[...]
> But even on Solaris, I find it quite strange that the 'real' prototype
> has a void pointer for the 'fromlen' sixth argument.
>
> Tor, if you're around, would it be possible to verify if the installed
> "/usr/include/sys/socket.h" is the proper one ? Or if besides
> <sys/types> and <sys/socket> we need to include another header file to
> get the proper prototype of recvfrom() ? Or if I'm missing the
> definition of some macro ? I'm also considering the possibility of
> _REENTRANT not being defined for the test causing the problem.

The manpage on Solaris says:

Sockets Library Functions recv(3SOCKET)

NAME
     recv, recvfrom, recvmsg - receive a message from a socket

SYNOPSIS
     cc [ flag... ] file... -lsocket -lnsl [ library... ]
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <sys/uio.h>

     ssize_t recv(int s, void *buf, size_t len, int flags);

     ssize_t recvfrom(int s, void *buf, size_t len, int flags,
     struct sockaddr *from, int *fromlen);
[...]
which seems pretty much the same as for Linux, except using int*
instead of socklen_t* for the 'fromlen' argument, and that extra
<sys/uio.h> header file.
Right now I can't do some actual testing, unfortunately, but at least
I can say that _REENTRANT isn't referred in any /usr/include/sys/*.h
files, except <sys/vmem.h>. (It's referred quite a bit in
/usr/include/*.h though)

-Tor
Received on 2008-07-21