From ad53561a7f7eefed42d0cb7b579582e809dafcfc Mon Sep 17 00:00:00 2001 From: "Nikola Z. Ivanov" Date: Thu, 3 Sep 2026 12:29:07 +0300 Subject: [PATCH] Move "Reasonable EOF on SOCK_SEQPACKET" from TODO to In-Progress Assuming this is mainly concerning UNIX domain sockets, it could possibly be done by raising the MSG_EOR flag on every message except the final empty EOF as well as on truncated messages. --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0b44ac4..4b9f7db 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,18 @@ similar functions have `AT_EMPTY_PATH`. **Use-Case:** When dealing with `O_PATH` file descriptors, allow re-opening an operable version without the need of `procfs`. +### Reasonable EOF on SOCK_SEQPACKET + +Zero size datagrams cannot be distinguished from EOF on +`SOCK_SEQPACKET`. Both will cause `recvmsg()` to return zero. + +Idea how to improve things: maybe define a new MSG_XYZ flag for this, +which causes either of the two cases result in some recognizable error +code returned rather than a 0. + +**Use-Case:** Any code that wants to use `SOCK_SEQPACKET` and cannot +effort disallowing zero sized datagrams from their protocol. + --- ### TODO @@ -797,18 +809,6 @@ speaking the 2nd idea makes the 1st idea half-way redundant. so on) needs this, so that it can reasonably handle SELinux AVC errors on received messages. -### Reasonable EOF on SOCK_SEQPACKET - -Zero size datagrams cannot be distinguished from EOF on -`SOCK_SEQPACKET`. Both will cause `recvmsg()` to return zero. - -Idea how to improve things: maybe define a new MSG_XYZ flag for this, -which causes either of the two cases result in some recognizable error -code returned rather than a 0. - -**Use-Case:** Any code that wants to use `SOCK_SEQPACKET` and cannot -effort disallowing zero sized datagrams from their protocol. - ### Reasonable Handling of SELinux dropping SCM_RIGHTS fds Currently, if SELinux refuses to let some file descriptor through, it