[zeromq-dev] platform checks.

Martin Sustrik sustrik at fastmq.com
Wed Nov 12 23:13:44 CET 2008


George,

> This should be changed as well,
> 
> in ysemaphore.h
> 
> #ifdef ZMQ_HAVE_WINDOWS
> #include <windows.h>
> #elif (defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_SOLARIS ||\
>     defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_QNXNTO)
> #include <semaphore.h>
> #else
> #include <pthread.h>
> #endif
> 
> to
> 
> #if (defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_OSX)
> #include <pthread.h>
> #elif defined ZMQ_HAVE_WINDOWS
> #include <windows.h>
> #else // default
> #include <semaphore.h>
> #endif

Done.

>>>>>>>            int flags;    <<<<<<
> #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_SOLARIS \
>     || defined ZMQ_HAVE_FREEBSD  || defined ZMQ_HAVE_OPENBSD  \
>     || defined ZMQ_HAVE_QNXNTO
> 
>             if (-1 == (flags = fcntl (r, F_GETFL, 0)))
>                 flags = 0;
> 
>             //  Set to non-blocking mode.
>             rc = fcntl (r, F_SETFL, flags | O_NONBLOCK);
>             errno_assert (rc != -1);
> 
> #elif
> #error nonblocking sockets not supported on this platform
> #endif
> 
> I felt the #ifdef O_NONBLOCK check was better for ZMQ-103

I've removed the test altogether as O_NONBLOCK seems to work on all the 
platforms we do support at the moment. If there's need for a different 
code on AIX or HP-UX (like using O_NDELAY) feel free to propose the fix.

Both changes were commited to the trunk. SVN rev. 624

Cheers.
Martin



More information about the zeromq-dev mailing list