Future proof use of SOCK_CLOEXEC #961

Open
opened 2025-08-16 15:28:27 +00:00 by helle · 0 comments
Member

For both the new use of SOCK_CLOEXEC and the use of it now for pipes needs to be updated to have runtime checks, with fallback. As even if SOCK_CLOEXEC is available at build time, it may not be available at runtime.

This due to us supporting running newer build binaries being run on older OS'es and the POSIX spec for it allowing it to be defined, but unimplemented at runtime.

Currently we would see very weird breakages if this situation occurs, which is not entirely unlikely and the runtime check is not on the hot path.

For both the new use of SOCK_CLOEXEC and the use of it now for pipes needs to be updated to have runtime checks, with fallback. As even if SOCK_CLOEXEC is available at build time, it may not be available at runtime. This due to us supporting running newer build binaries being run on older OS'es and the POSIX spec for it allowing it to be defined, but unimplemented at runtime. Currently we would see very weird breakages if this situation occurs, which is not entirely unlikely and the runtime check is not on the hot path.
helle self-assigned this 2025-08-16 15:28:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#961
No description provided.