]> git.ipfire.org Git - thirdparty/curl.git/commit
socketpair: support pipe2 where available
authorAndy Pan <i@andypan.me>
Sun, 6 Apr 2025 12:37:10 +0000 (20:37 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 7 Apr 2025 10:35:17 +0000 (12:35 +0200)
commit131a2fd5aaa1a809211695d2ef8151ffadbebc0c
treee1b4359fa36349b599a9026cb83a4c9c8393beef
parent8988f33f622dd70870b525cab60279eee81ac960
socketpair: support pipe2 where available

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 #16987
CMake/unix-cache.cmake
CMake/win32-cache.cmake
CMakeLists.txt
configure.ac
lib/curl_config.h.cmake
lib/socketpair.c