]> git.ipfire.org Git - thirdparty/curl.git/commit
socket: use accept4 when available
authorAndy Pan <i@andypan.me>
Sat, 5 Apr 2025 15:55:32 +0000 (23:55 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 6 Apr 2025 11:08:33 +0000 (13:08 +0200)
commit3d02872be7cfe6dcdef4b02321b47af19e1ce268
tree27a09b4f010cd15638114f8f3ebdc0a6fbf02208
parent2f5e4e0db464acff921901b7bf98dd94f8a73745
socket: use accept4 when available

Linux, *BSD, and Solaris support accept4 system call that enables the
caller to assign additional flags and save some extra system calls. It
can come in handy when O_NONBLOCK or/and FD_CLOEXEC is/are required on a
socket after being accepted.

Ref:
https://man7.org/linux/man-pages/man2/accept.2.html
https://man.freebsd.org/cgi/man.cgi?query=accept4
https://man.dragonflybsd.org/?command=accept&section=2
https://man.openbsd.org/accept.2
https://man.netbsd.org/accept.2
https://docs.oracle.com/cd/E88353_01/html/E37843/accept4-3c.html
https://www.gnu.org/software/gnulib/manual/html_node/accept4.html

Closes #16979
CMake/unix-cache.cmake
CMake/win32-cache.cmake
CMakeLists.txt
configure.ac
lib/cf-socket.c
lib/curl_config.h.cmake
lib/memdebug.c
lib/memdebug.h