Repository navigation
0.1.0: openkal written above a POSIX C library - #1
Merged
Merged
Conversation
An implementation of openkal 0.25 above the system's own C library, for the systems whose stable interface is the C library: fifteen interfaces (abort, stream, memory, env, time, random, fs, process, task, exec, terminal, timeout, map, region, space). net, datagram, prof and debug are absent, not stubbed: their names are not defined and neither the manifest nor kal_interfaces() states them. It states requires = ["mcpp:c-abi"], so it is never placed beneath a C library written above openkal. CI runs openkal's conformance suite for every stated interface through the mtest engine on Linux (gcc, llvm) and macOS, with the three-way check of the manifest, kal_interfaces() and the exported names, and reports each job and the workflow run.
…wait relative to now, no region at an address execve of /dev/fd/N is refused there, so a start uses F_GETPATH where the system states it. Its condition variables have no monotonic clock, so a bound is given relative (pthread_cond_timedwait_relative_np). Without MAP_FIXED_NOREPLACE or MAP_EXCL a region at an address is refused, as the unclaimed KAL_EXEC_PROP_PLACE states.
…t it On macOS a text file recorded as startable was refused ENOEXEC by the first attempt and then reported by the second (/dev/fd), which answers about the name.
- The null device at standard input is opened close-on-exec too ((i == 0 ? O_RDONLY : O_WRONLY) | O_CLOEXEC), and a failure to open it is the caller's, before the start. - The environment given is examined before anything is allocated or opened, and every path out after allocation releases what it took. - The copy calls only what a signal handler may: the /dev/fd name is written before the start, and a position that was placed and cannot be is reported through the report pipe and ends the copy. A position neither placed nor given the null device keeps the caller's, as inherited, without being duplicated. - The stop word is answered only where the context that wakes its waiters was created: otherwise both pipe ends are closed, no handler is installed, and kal_process_stop_requested answers null.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openkal-posix 0.1.0 is an implementation of openkal 0.25 written above the system's POSIX C library. It serves the systems whose stable interface is the C library (OpenBSD, Haiku, GNU/Hurd, illumos) and any POSIX host without an implementation of its own, for programs and for
okrun(design 2026-11-10 §6.2 K2).provides = ["mcpp:kernel-abi=openkal"],requires = ["mcpp:c-abi"](E14): it is placed above a C library, never beneath one written above openkal.[kernel-abi] provides-interfaceslists fifteen interfaces: abort, stream, memory, env, time, random, fs, process, task, exec, terminal, timeout, map, region and space. net, datagram, prof and debug are absent, not stubbed (SPEC 6.1): their names are not defined, and neither the manifest norkal_interfaces()states them.kal_err_not_supported(clause 6.2). This covers confinement, bound lifetime and one-string starts; the 0.24 observable units, unit usage and limits; rename without replace; and the timeout forms of accept and recv_from, whose resources are the absent network interfaces.Starting point: the earlier experiment, which measured 148 held, 8 did not hold and 4 not observed, then hung in openkal.process. The changes from it:
kal_process_terminatesent SIGKILL. It now sends SIGTERM, a request a program may take over, andkal_process_stop_requestedandkal_process_end_as_requestedare implemented. The handlers count each request and skip zero (0.25); they write to a pipe so that a context can wake the word's waiters; and a request ignored before arming stays ignored.KAL_RESOURCESas the other implementations convey it. The null device beside a placed stream at the same position is refused.kal_fs_hard_linkuseslinkat; a directory is refused before the call, and EXDEV → not_supported.F_OFD_SETLK, elseflockfor the whole file), and a mode that is neither shared nor exclusive is refused.self_size, and listings respectwanted.kal_exec_map_partvalidates alignment, granularity, the file's end and the bits ofhow, and honours PREFETCH.kal_map_filerefuses a region beyond the file's end.kal_memory_infostates total and available pages where the system does.Test plan
run-conformance.sh openkal-posix . full,exec,random,terminal,space,timeout,map,region: 329 held, 0 did not hold, 12 not observed. Under mtest 0.5.2: 348 passed, 0 failed, 12 skipped. The three-way check: "the exported names state the interfaces the manifest states".getentropyfrom <sys/random.h>.F_GETPATH); an answer about the program itself (ENOEXEC) ends the attempts.pthread_cond_timedwait_relative_np), since its condition variables have no monotonic clock.