mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
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
This commit is contained in:
parent
8988f33f62
commit
131a2fd5aa
6 changed files with 23 additions and 2 deletions
|
|
@ -281,7 +281,7 @@ endif()
|
|||
|
||||
include(PickyWarnings)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if(CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
string(APPEND CMAKE_C_FLAGS " -D_GNU_SOURCE") # Required for sendmmsg() and accept4()
|
||||
endif()
|
||||
|
||||
|
|
@ -1772,6 +1772,7 @@ check_symbol_exists("getaddrinfo" "${CURL_INCLUDES};stdlib.h;string.h" HAVE_
|
|||
check_symbol_exists("getifaddrs" "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS) # ifaddrs.h
|
||||
check_symbol_exists("freeaddrinfo" "${CURL_INCLUDES}" HAVE_FREEADDRINFO) # ws2tcpip.h sys/socket.h netdb.h
|
||||
check_function_exists("pipe" HAVE_PIPE)
|
||||
check_function_exists("pipe2" HAVE_PIPE2)
|
||||
check_function_exists("eventfd" HAVE_EVENTFD)
|
||||
check_symbol_exists("ftruncate" "unistd.h" HAVE_FTRUNCATE)
|
||||
check_symbol_exists("getpeername" "${CURL_INCLUDES}" HAVE_GETPEERNAME) # winsock2.h unistd.h proto/bsdsocket.h
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue