O_CLOEXEC flag used in ip.cpp:192 is supported only on Linux kernels 2.6.27+
When building ZeroMQ versions 2.1.10+ build system have to check whether the underlying kernel version is actually 2.6.27 or newer (or maybe check it on runtime), even if the O_CLOEXEC flag is defined. Some virtualization environment, like OpenVZ, allow to run newer Linux systems (like Lucid) on older host systems (like Hardy), which will end up in new libc dev headers with O_CLOEXEC defined running on older kernel which doesn't support it, which in order will block all TCP communications due to an inability to bind a socket at all.
Closing as fixed since Ubuntu guys will use their own downstream patch
there is nothing one can further do when there is no CLOEXEC. A socket without CLOEXEC is better than none at all.
The #ifdef will never be true on ubuntu systems with zeromq anyway.
Thanks for the patch, are you sure you want this commented out?
@@ -201,7 +207,8 @@ int zmq::open_socket (int domain_, int t
// between socket creation and this point).
#if !defined SOCK_CLOEXEC && defined FD_CLOEXEC
int rc = fcntl (s, F_SETFD, FD_CLOEXEC);
errno_assert (rc != -1);
+ /* ignore to be able to run build testsuites on hardy builders
+ errno_assert (rc != -1); */
yes you can close it fixed if you don't want to use a runtime check.
I have attached the patch I'm going to apply to ubuntu (based on 2.1.10)
runtime SOCK_CLOEXEC check, based on 2.1.10