-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
socketpair: support pipe2 where available #16987
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
Conversation
By replacing pipe with pipe2, it would save us 4 extra system calls of setting O_NONBLOCK and O_CLOEXEC. This system call is widely supported across UNIX-like OS's: Linux, *BSD, and SunOS derivatives - Solaris, illumos, etc. Ref: https://man7.org/linux/man-pages/man2/pipe.2.html https://man.freebsd.org/cgi/man.cgi?query=pipe https://man.dragonflybsd.org/?command=pipe2 https://man.netbsd.org/pipe.2 https://man.openbsd.org/pipe.2 https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html https://illumos.org/man/2/pipe2 https://www.gnu.org/software/gnulib/manual/html_node/pipe2.html
For the record: we prefer using eventfd, so this is only really a win for systems without eventfd but with pipe2() |
True, check out https://www.gnu.org/software/gnulib/manual/html_node/eventfd.html Aside from that, users are allowed to disable
In that case, |
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
Thanks! |
By replacing pipe with pipe2, it would save us 4 extra system calls of setting O_NONBLOCK and O_CLOEXEC. This system call is widely supported across UNIX-like OS's: Linux, *BSD, and SunOS derivatives - Solaris, illumos, etc. Ref: https://man7.org/linux/man-pages/man2/pipe.2.html https://man.freebsd.org/cgi/man.cgi?query=pipe https://man.dragonflybsd.org/?command=pipe2 https://man.netbsd.org/pipe.2 https://man.openbsd.org/pipe.2 https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html https://illumos.org/man/2/pipe2 https://www.gnu.org/software/gnulib/manual/html_node/pipe2.html Closes curl#16987
By replacing pipe with pipe2, it would save us 4 extra system calls of setting O_NONBLOCK and O_CLOEXEC.
This system call is widely supported across UNIX-like OS's: Linux, *BSD, and SunOS derivatives - Solaris, illumos, etc.
Ref:
https://man7.org/linux/man-pages/man2/pipe.2.html
https://man.freebsd.org/cgi/man.cgi?query=pipe
https://man.dragonflybsd.org/?command=pipe2
https://man.netbsd.org/pipe.2
https://man.openbsd.org/pipe.2
https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html
https://illumos.org/man/2/pipe2
https://www.gnu.org/software/gnulib/manual/html_node/pipe2.html