curl-users
RE: 7.9.6 sparc-sun-solaris2.4 ftp timeout after connect?
Date: Mon, 29 Apr 2002 13:18:00 -0400
> -----Original Message-----
> From: Bjorn Reese [mailto:breese_at_mail1.stofanet.dk]
> Sent: Monday, April 29, 2002 12:47 PM
> To: Rich Gray
> Cc: 'Daniel Stenberg'; Curl Mailinglist
> Subject: Re: 7.9.6 sparc-sun-solaris2.4 ftp timeout after connect?
>
>
> Rich Gray wrote:
>
> > Actually, it needed more than that to
> > compile:
> >
> > #if defined(HAVE_O_NONBLOCK)
> > # undef HAVE_O_NONBLOCK
> > # define HAVE_FIONBIO
> > # include <sys/filio.h>
> > #endif
> >
> >
> > But still fails with EINVAL.
>
> I found the following comment in the "Solaris 1.x to Solaris 2.x
> Transition Guide" of the Solaris 2.4 System Administrator
> AnswerBook:
>
> "read(2V) -- SysV
>
> The nbyte argument to read() is of type int in SunOS release 4.x
> and of type unsigned in SunOS release 5.4. The SunOS 5.4 read()
> system call does not support BSD 4.2 style non-blocking I/O (with
> the FIONBIO ioctl() request or a call to fcntl(2V) using the
> FNDELAY flag from <sys/file.h> or the O_NDELAY flag from <fcntl.h>
> in the 4.2BSD environment) as does SunOS release 4.x read() routine."
>
> This seems to indicate that non-blocking sockets aren't possible
> on Solaris 2.4 (at least, it excludes all the alternatives that I
> am familiar with). However, before abandonning all hope we could
> try with fcntl(FNDELAY).
>
Hacking connect.c:
int Curl_nonblock(int socket, /* operate on this */
int nonblock /* TRUE or FALSE */)
{
#include <sys/file.h>
int flags;
flags = fcntl(socket, F_GETFL, 0);
if (TRUE == nonblock)
return fcntl(socket, F_SETFL, flags | FNDELAY);
else
return fcntl(socket, F_SETFL, flags & (~FNDELAY));
#if 0
...
No joy. :(
Received on 2002-04-29