mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-24 06:59:50 -05:00
os: wrap socket(SOCK_CLOEXEC) calls
Some system C libraries do not offer SOCK_CLOEXEC flag. Add a new header for OS compatibility wrappers. Wrap socket() calls into wl_os_socket_cloexec() which makes sure the O_CLOEXEC flag gets set on the file descriptor. On systems having SOCK_CLOEXEC this uses the old socket() call, and falls back if it fails due to the flag (kernel not supporting it). wayland-os.h is private and not exported. Add close-on-exec tests for both normal and forced fallback paths. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
da6b1a8e47
commit
7134a439c1
7 changed files with 211 additions and 3 deletions
|
|
@ -14,6 +14,8 @@ libwayland_util_la_SOURCES = \
|
|||
connection.c \
|
||||
wayland-util.c \
|
||||
wayland-util.h \
|
||||
wayland-os.c \
|
||||
wayland-os.h \
|
||||
wayland-private.h
|
||||
|
||||
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue