zmq_ppoll mostly mimics zmq_poll behavior, except for the added feature of being able to specify a signal mask. Signals in this mask will be blocked during execution of zmq_ppoll. Switching of the process' active signal mask happens atomically with the actual poll call, so that no race conditions can occur. This behavior is useful when one wants to gracefully handle POSIX signals without race conditions. See e.g. the discussion below https://250bpm.com/blog:12/ for an explanation.
Also includes two new tests:
1. test_zmq_ppoll_fd does the same thing as test_zmq_poll_fd, demonstrating backwards compatibility with zmq_poll when used with a default signal mask.
2. test_zmq_ppoll_signals demonstrates the use of zmq_ppoll with a signal mask, blocking out SIGTERM everywhere except in zmq_ppoll, allowing to handle the signal in one place without having to worry about race conditions.
Solution: switch to Github Actions
Travis recently started enforcing credits for OSS projects without
any funding. While it is possible to get free credits, it is a manual
step that involves contacting customer support via email and asking to
add them, every week. While this does not require money, it requires
something far scarcer: volunteers time.
Drop Travis and migrate to Github Actions.
* Problem: No direct support for setting socket priority
Solution: Add ZMQ_PRIORITY socket option, which sets the
SO_PRIORITY socket option on the underlying socket. This
socket option is not supported under Windows. Check option
and set socket option on creation of underlying socket.
* build_ios.sh now build for different archs
* change typo on build_ios.sh
Co-authored-by: Roberto Santacroce Martins <roberto.martins@transferoswiss.ch>
Solution: move all corpora to the zeromq/libzmq-fuzz-corpora repository
for easier handling, and to avoid inflating the size of zeromq/libzmq.
Clone it for the CI on the fly.
* Allow CMAKE to generate ws and wss transports
I guess there is little use of just ws transport, so by default
GnuTLS (and libsodium) are enabled
* cmake libzmq including wss transport (ubuntu 19.10 and ubuntu 19.10 + wsl 1.0)
test_security_fails (libsodium assert !?)
* updated relicense
* make external libs gnutls nss sodium optional
* #ifdef WSS classes and functions, build test*ws* only if correct libs are included, warning if libs not present
* make libsodium optional
* cmake fix tests TIPC transport
* clang-format pointed out a wrongly placed #ifdef
* GnuTLS before 3.6.7 is not safe
* msvc doesn't agree with strlen in array declaration, test_socks now at least compiles on windows
* windows: libsodium build fails, missing include dirs set by env var
* ws transport test only works when GnuTLS is found
* Fixed condition to use NSS / built in SHA1, so that test_ws_transport should now pass, also when GnuTLS is not found
Solution: Modify the build scripts so the user can specify the platform
for which to build, e.g. `./build.sh arm`. This approach originally
significantly reduces the parameters which have to be set before running
the script.
Further the build process is documented in a README now.
Solution: use libbsd by default when available, and the internal implementation
only as a fallback, to take advantage of Linux distros maintenance of the
string libraries.
Solution: Migrate build scripts from Android NDK r11c to r20.
- Standalone toolchain
- Migration from GCC to Clang
- Migration from libgnustl to libc++
- Dropped support for API level below 16 (Android 4.1), previously it was API level 9 (Android 2.3)
- Dropped support for mips architecture
- The build script now start the build of all 4 Android architectures (arm, arm64, x86, x86_64)
Solution: detect cacheline size for aligment purposes at build time
instead of hard-coding it, so that PPC and S390 can align to a value
greater than the 64 bytes default.
Uses libc getconf program, and falls back to the previous value of 64
if not found.
Solution: set the appropriate options, environment variables and paths
so that the host pkg-config files are ignored, and the target ones are
used instead (if any)
Solution: use requires.private, which pkg-config expands recursively
so that dependencies of dependencies can be linked against when
using pkg-config --static
* always run tests from tarball of `make dist`
ensures that tests will not pass if critical files are omitted from releases
* add explicit make dist only for non-default builds
distcheck should already cover this for default builds
* don’t verify that valgrind/coverage tests can be run from dists
* add various files missing from dists
- missing template from cmake
- add missing android build files
- add some missing ci_build.sh scripts
* Problem: Still need to port over more files to VxWorks 6.x
Solution: Port more files to VxWorks 6.x
* Problem: Need to port over remaining files to VxWorks 6.x. Also remove POSIX thread dependency for VxWorks (because of priority inversion problem in POSIX mutexes with VxWorks 6.x processes)
Solution: Port over remaining files to VxWorks 6.x. Also removed POSIX thread dependency for VxWorks
* Problem: Needed to modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x.
Solution: Modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x
* Problem: TIPC availability check is too strict
Solution: at build time only check if the API is available. In the tests
do a first check and a skip if the functionality is not available.
TIPC needs an in-tree but not loaded by default kernel module, tipc.ko
to be loaded, which requires root, so it is unlikely to be available on
any build system by default.
This will allow most distributions to ship with TIPC support built in,
and to avoid tests failure if the module is not there.
* Problem: no Travis tests for TIPC
Solution: mark one job with sudo: required and load the kernel module
* Problem: CMake fails when test returns 77 (skip)
Solution: set property to let it mark the test as skipped as intended
* Background thread scheduling
- add ZMQ_THREAD_AFFINITY ctx option; set all thread scheduling options
from the context of the secondary thread instead of using the main
process thread context!
- change ZMQ_THREAD_PRIORITY to support setting NICE of the background
thread when using SCHED_OTHER
Solution: generate list of sources and headers with:
ls -1 src/*cpp | sort | sed 's|src/\(.*\)| <File RelativePath="..\\..\\..\\..\\src\\\1" />|g'
ls -1 src/*hpp | sort | sed 's|src/\(.*\)| <File RelativePath="..\\..\\..\\..\\src\\\1" />|g'
and add them.
Linux now supports Virtual Routing and Forwarding (VRF) as per:
https://www.kernel.org/doc/Documentation/networking/vrf.txt
In order for an application to bind or connect to a socket with an
address in a VRF, they need to first bind the socket to the VRF device:
setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);
Note "dev" is the VRF device, eg. VRF "blue", rather than an interface
enslaved to the VRF.
Add a new socket option, ZMQ_BINDTODEVICE, to bind a socket to a device.
In general, if a socket is bound to a device, eg. an interface, only
packets received from that particular device are processed by the socket.
If device is a VRF device, then subsequent binds/connects to that socket
use addresses in the VRF routing table.