Skip to content
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

Automatically apply SO_NOSIGPIPE or a platform equivalent socket option when available #200

Open
mattrm456 opened this issue Aug 5, 2024 · 1 comment

Comments

@mattrm456
Copy link
Contributor

mattrm456 commented Aug 5, 2024

Traditionally, the Unixes raise a SIGPIPE signal for a write failure (usually when it occurs asynchronously.) Also traditionally, this is annoying for userspace programmers which prefer to handle the error as a return code or polled error. This desired behavior may be achieved by ignoring SIGPIPE, but this signal management must be applied process-wide. Automatically apply the non-portable SO_NOSIGPIPE socket option upon socket creation, or the MSG_NOSIGNAL flag when calling sendmsg, or any platform-specific equivalent, when available. These socket options and flags. achieve the same desired behavior but on a per-socket basis and do not require process-wide signal management.

@mattrm456
Copy link
Contributor Author

The MSG_NOSIGNAL flag is already automatically used for sendmsg calls on Linux. A PR need only address applying the SO_NOSIGPIPE (if available on the target platform.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant