cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: updated test

From: Bjorn Reese <breese_at_mail1.stofanet.dk>
Date: Fri, 28 Sep 2001 10:50:26 +0000

Daniel Stenberg wrote:

> O_NONBLOCK everywhere?

O_NONBLOCK is part of both POSIX and XPG3, and is thus supported on most
Unix platforms I know of. The exceptions are AIX 3.x and SunOS 4.1.x, which
both defines O_NONBLOCK but does not work correctly. On those two platforms
ioctl(FIOBIO) has to be used instead. Your configure script does not catch
this case, so if you want to support these two platforms you need to put
something like this in front of the nonblocking code

#if defined(sun) || defined(__sun__) || defined(__SUNPRO_C) ||
defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS
# else
# define PLATFORM_SUNOS
# endif
#endif
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX4)
# define PLATFORM_AIX_V3
#endif

#if defined(PLATFORM_SUNOS) || defined(PLATFORM_AIX_V3)
# undef HAVE_O_NONBLOCK
# define HAVE_FIONBIO
#endif

Yes, I know this is #ifdef hell, but I usually put this in separate header
files and try to use as intuitive macro names as possible.
Received on 2001-09-28