mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:43:32 +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
|
|
@ -577,7 +577,7 @@ AM_CONDITIONAL(BUILD_UNITTESTS, test x$supports_unittests = xyes)
|
|||
# In order to detect support of sendmmsg() and accept4(), we need to escape the POSIX
|
||||
# jail by defining _GNU_SOURCE or <sys/socket.h> will not expose it.
|
||||
case $host_os in
|
||||
linux*)
|
||||
linux*|cygwin*|msys*)
|
||||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -4124,6 +4124,7 @@ AC_CHECK_FUNCS([\
|
|||
gettimeofday \
|
||||
mach_absolute_time \
|
||||
pipe \
|
||||
pipe2 \
|
||||
poll \
|
||||
sendmmsg \
|
||||
sendmsg \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue