-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass MSG_NOSIGNAL to sendmsg on OpenBSD #549
Conversation
This avoids Asio applications exiting with unexpected SIGPIPEs on OpenBSD. Note that FreeBSD has the SO_NOSIGNAL socket option so doesn't need this.
I also came across this while getting a unit test (test_url_seed's url_seed_ssl) to pass on OpenBSD for libtorrent-rasterbar. I had used a reduced version of this patch that doesn't cover all the sendmsg possibilities. This did allow the test to pass.
@arvidn from libtorrent-rasterbar had suggested that this be submitted as a PR to boost asio. I have not done so. Thank you for submitting this. explanation: arvidn/libtorrent#4211 (comment) |
I see NetBSD also has the socket option. Though the Asio code does not utilize it on |
Based on these hints from the OpenBSD generic porting tips and Sascha Wildner from DragonflyBSD, https://www.openbsd.org/faq/ports/guide.html#PortsGeneric
https://www.dragonflybsd.org/mailarchive/users/2011-03/msg00028.html
After @brad0's mention of NetBSD I checked all the BSDs. NetBSD and FreeBSD have SO_NOSIGPIPE. DragonflyBSD and OpenBSD do not have SO_NOSIGPIPE. SO_NOSIGPIPE: dragonflybsd: https://man.dragonflybsd.org/?command=setsockopt§ion=ANY netbsd, freebsd, dragonflybsd and openbsd all have MSG_NOSIGNAL. MSG_NOSIGNAL: |
|
Fixing this for Solaris and AIX would also be highly welcome. |
Fixed in asio 1.18.1 / boost 1.75. |
This avoids Asio applications exiting with unexpected SIGPIPEs on
OpenBSD. Note that FreeBSD has the SO_NOSIGPIPE socket option so doesn't
need this.