From ce34a7b4b1f7538e56570d0fb7e3629966da18f5 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Thu, 1 Oct 2026 20:07:55 +0800 Subject: [PATCH] FDOP_CLOSE above position two cites the clause it rests on openkal 0.14.1 states in clause 7.13 that a started program receives the three streams and the granted directories and no other handle, which is the ground on which closing a descriptor above two is accepted and does nothing. The comment names the clause, the implementation that did not satisfy it before openkal-linux 0.15.1 (mcpplibs/openkal-linux#30), and the one exception the clause permits. No code changes and no release. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- port/src/okm_spawn.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/port/src/okm_spawn.c b/port/src/okm_spawn.c index 0883104..b9eeb2b 100644 --- a/port/src/okm_spawn.c +++ b/port/src/okm_spawn.c @@ -487,7 +487,17 @@ int __okm_spawn_common(pid_t* restrict res, const char* restrict path, * value that looks like one means the opposite. Accepting it and * doing nothing would hand a program the standard input its * caller had just taken away, which is the failure a caller - * cannot see and cannot act upon. */ + * cannot see and cannot act upon. + * + * Above position two the answer rests on openkal clause 7.13, + * which requires it of every implementation since 0.14.1: a + * started program receives the three streams and the directories + * granted, and no other handle, including one this program itself + * inherited. openkal-linux before 0.15.1 conveyed one such handle, + * for the directory the program was found in, and nothing here + * could close it. The one exception the clause permits, a handle + * for the program itself left to a `#!' script's interpreter, is + * not one a caller could name either. */ if (op->fd > 2) break; refused = ENOSYS; break;