• Show log

    Commit

  • Hash : e66df92c
    Author : Andy Pan
    Date : 2024-03-07T16:19:11

    Accept SOCK_NONBLOCK/SOCK_CLOEXEC in type argument of socketpair (#1567)
    
    Setting `SOCK_NONBLOCK` and `SOCK_CLOEXEC` in the `type` argument of `socketpair()` is widely supported across UNIX-like OS: Linux, *BSD, Solaris, etc., as is the `socket()`. This will conserve several extra system calls, we should use it where available.
    
    ### References
    
    - [socketpair(2) on Linux](https://man7.org/linux/man-pages/man2/socketpair.2.html#HISTORY)
    - [socketpair(2) on FreeBSD](https://man.freebsd.org/cgi/man.cgi?query=socketpair&sektion=2#DESCRIPTION)
    - [socketpair(2) on DragonFly](https://man.dragonflybsd.org/?command=socketpair&section=2)
    - [socketpair(2) on NetBSD](https://man.netbsd.org/socketpair.2#DESCRIPTION)
    - [socketpair(2) on OpenBSD](https://man.openbsd.org/socketpair.2)
    - [socketpair(3C) on Solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/socketpair-3c.html)
    
    Changelog:
    - Set SOCK_NONBLOCK and SOCK_CLOEXEC in the type argument of socketpair
    - Avoid EPROTOTYPE on macOS and OpenBSD
    - Eliminate the warnings about unused variables
    - Add some comments