Skip to content

0.14.0 --- a start that is not a program reports ENOEXEC, and chmod can grant the one bit openkal now answers - #35

Merged
Sunrisepeak merged 3 commits into
mainfrom
openkal-0.13
Sep 17, 2026
Merged

Sunrisepeak merged 3 commits into
mainfrom
openkal-0.13

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

openkal 0.13 closed two gaps a consumer met from opposite sides (issue #28):

  • okm_errno had no case for kal_err_not_program, so posix_spawn of a file that exists, is executable, and is not a program reported EIO (a device failure that never occurred) instead of ENOEXEC. It now does; no /bin/sh fallback is added for it, matching musl's own execvp and the existing decision in musl/PATCHES.md.
  • chmod/fchmodat (and whatever std::filesystem::permissions reaches) now route to kal_fs_set_executable_at for the one request this port can honestly grant: the execute bits, set to match the read bits this port already reports, or cleared. Anything else is refused with ENOSYS rather than rounded to a mode stat will not then show. A no-op equal to the mode already reported succeeds even where the volume declines KAL_FS_PROP_EXECUTABLE. fchmod stays ENOSYS unconditionally (no name to hand the call). stat/fstat/fstatat/statx and access(X_OK) read the same field back.

examples/subprocess asserts both on every CI row, and fails against the unmodified port. README's limits table is rewritten for permission bits, whether a file may be executed, and the 127 claim, and gains the ecosystem design record's R1/R2 as limits (one C runtime and one C++ runtime per image; a context a platform library creates has no C library state).

Tracked docs and comments are stripped of emoji.

Carries openkal 0.13.0, openkal-linux 0.13.0, openkal-macos 0.10.0 and openkal-windows 0.8.0 (features unchanged), package version 0.14.0.

Test plan

  • mcpp build against ../openkal and ../openkal-linux on openkal-0.13 (via tools/working-trees.sh)
  • examples/subprocess probe: red against the unmodified port (3 failures: ENOEXEC not reported, chmod no-op refused), green after this change
  • examples/posix, examples/surface, examples/net, examples/identifiers probes still pass
  • CI: linux (gcc/llvm), macos (llvm), windows (gcc) rows — depends on sibling openkal-macos/openkal-windows branches also being ready

…an grant the one bit openkal now answers

openkal 0.13 closed two gaps a consumer met from opposite sides (issue #28).
`okm_errno` had no case for `kal_err_not_program`, so `posix_spawn` of a file
that exists, is executable, and is not a program fell to the default arm and
reported EIO --- a device failure that never occurred --- instead of ENOEXEC,
the condition every host this port targets reports natively. It now does, and
no `/bin/sh` fallback is added for it: musl's own `execvp` has none either
(musl/PATCHES.md already declines the analogous case for `:`).

`chmod`, `fchmodat` and whatever `std::filesystem::permissions` reaches now
route to `kal_fs_set_executable_at` for the one request this port can honestly
grant: the execute bits, set to match the read bits this port already reports,
or cleared. A request that changes anything else --- the read or write bits,
which are always uniform across the three classes here --- is refused with
ENOSYS rather than rounded to a mode `stat` will not then show. A no-op equal
to the mode already reported succeeds even where the volume declines
KAL_FS_PROP_EXECUTABLE. `fchmod` stays ENOSYS unconditionally: this port keeps
no name for an open file to hand the call. `stat`/`fstat`/`fstatat`/`statx`
and `access(X_OK)` read the same field back.

examples/subprocess asserts both, on every row, and failed against the
unmodified port before this change. README's limits table states what changed
and versions it per implementation, and adds the ecosystem design record's R1
and R2 as limits of their own: one C runtime and one C++ runtime per image,
and a context a platform library creates has no C library state.

Tracked docs and comments are stripped of emoji.

Carries openkal 0.13.0, openkal-linux 0.13.0, openkal-macos 0.10.0 and
openkal-windows 0.8.0.
Name resolution by name fails there: musl's resolver reads
/etc/resolv.conf through this port's filesystem layer, and openkal defines
no name resolution (SPEC.md clause 3.4, clause 11 item 5) for a nameserver
list Windows keeps where this port cannot read it. getaddrinfo reports
EAI_AGAIN rather than guessing one; a numeric address is unaffected.
Measured under Wine with openkal-windows 0.7.4 / this package's 0.13.5.

And a C program linking this package directly for x86_64-windows-gnu fails
to link on three compiler-rt builtins this package carries no archive for;
a C++ program through openkal-llvm-runtime receives them with the rest of
the runtime it names. Measured with mcpp 2026.9.17.2, including the fix for
mcpp#662. Neither is addressed in this change.
… position, and the install lines

A chmod that would change a directory's execute bits reached
kal_fs_set_executable_at, which refuses a directory, and reported EISDIR; it now
reports ENOSYS like every other change this port cannot express, and the
subprocess probe asserts it. The comment in fill_kstat claimed stat and
access(X_OK) read an unanswered position the same way; they do not, and did not
before 0.14.0 (stat: no execute bits; access: yes), which the comment and the
README row now state. README install lines name 0.14.0 and runtime 0.10.0, and
the carried-by table gains the 0.14.0 row.
@Sunrisepeak
Sunrisepeak merged commit d50687d into main Sep 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant