Skip to content

gsocket/inotify/gwakeup: Use SOCK_NONBLOCK and O_NONBLOCK to avoid fcntl() syscalls where possible

Philip Withnall requested to merge pwithnall/glib:socket-nonblock into main

Use the support for SOCK_NONBLOCK and O_NONBLOCK in modern (actually, it’s quite old now) Linux distributions to avoid some unnecessary and non-atomic fcntl() calls after creating a socket or pipe in various places.

See the individual commit messages for specific details.

Notably, this adds to the API contract for g_unix_open_pipe(), so it cannot land in a 2.76.x release; it has to wait until 2.78.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Merge request reports