Repository navigation
Releases: mcpplibs/os
Release list
0.2.6
0.2.5
openkal 0.19.0 (openkal-linux 0.20.0, openkal-macos 0.17.0, openkal-windows 0.15.0, openkal-emscripten 0.8.0). The interface is unchanged. An ok image over this release selects openkal-platform 0.20.0.
os 0.2.4
- openkal 0.18. openkal 0.18.0 and its implementations: openkal-linux 0.19.0, openkal-macos 0.16.0, openkal-windows 0.14.0 (openkal.map), openkal-emscripten 0.7.0 (openkal.map absent).
- An ok image over this release selects openkal-platform 0.19.0 or a later group naming openkal 0.18: the openkal rows of mcpp 2026.10.31.2 pin 0.18.0, whose group names openkal 0.17.1. CI's ok images select it with MCPP_PLATFORM; checks/hosted with its manifest.
os 0.2.3
openkal-linux 0.18.3: every directory handle is opened with O_PATH, so a program started by absolute name is found in a directory the process may search but not read (the Android app sandbox, mcpp-community/mcpp#857). CI on mcpp 2026.10.30.1; checks/hosted on openkal-platform 0.18.0.
os 0.2.1
- The ok-image targets take their C library, C++ run-time and loader from
their platform.[target.'cfg(os = "openkal")']no longer declares
openkal-llvm-runtime or openkal-tools: mcpp 2026.10.27.1 selects
openkal-platform for<arch>-openkal(mcpp SPEC-013). CI finds the runner
throughmcpp toolchain install --targetandmcpp self env --target.
The package builds and its tests pass in every arrangement of the program's C
library on Linux, macOS and Windows: the system's own (glibc, libSystem, the
Microsoft C runtime), and a C library that sits on openkal (openkal-musl with
openkal-llvm-runtime, mcpp docs/24) on the system's own triple. Under the
second, a C library presents POSIX and openkal, not the system: its headers are
not the SDK's, on Windows its data model is LP64 and its wchar_t 32 bits, and
its descriptors, signals, uname, sysinfo and syscall are its own.
- The units beside openkal reach each system through that system's stable
interface, not through the C library.- Linux: the kernel's calls, one trap per architecture
(src/linux/kernel.h,src/linux/arch/). These cover the machine's name
and memory, a volume's kind and an exchange of two entries. In the second
arrangement the C library had answeredopenkalfor the machine, had no
sysinfo, and turnedrenameat2(RENAME_EXCHANGE)into a plain rename that
replaced the second entry. - macOS: the kernel's calls for a volume's kind and an exchange
(src/macos/kernel.h, as openkal-macos itself does), and the libSystem
names no C library defines for sysctl and the host's statistics
(src/macos/darwin.h). These are declared rather than included from the
SDK. A link whose libSystem is openkal-macos's stub binds them when the
program is loaded (-U). - Windows:
src/windows/win32.hdeclares DWORD as 32 bits and WCHAR as
UTF-16 (char16_t) under every C environment. Names reach the system as
UTF-8 converted to UTF-16, never throughpath::c_str()(R7). The
kernel32 names that openkal-windows does not itself call are found when
first called, so a toolchain without the system's import libraries links
the package.
- Linux: the kernel's calls, one trap per architecture
- The process's output and its ending for a closed reader are changed where
the process keeps them.- On Linux and macOS, the diversion of the standard output (
output_to_error),
the reset of SIGPIPE beforeexecandend_as_output_closeduse the
kernel's descriptors and dispositions (src/posix/kernel.h): what openkal's
standard output, the C library's and a started program all use. - On Windows the diversion moves the Microsoft C runtime's descriptor, as
before (src/windows/crt/stdio.cpp). For a C library on openkal it moves
that library's descriptor and the process's standard handle, each apart
(src/windows/posix/stdio.cpp). The manifest selects the form by
cfg(c-abi = "musl").
- On Linux and macOS, the diversion of the standard output (
checks/hostedbuilds the package's tests over openkal-musl and
openkal-llvm-runtime. CI runs them on Linux, macOS and Windows, beside the
native rows and the ok images. Locally, the native and hosted suites pass on
Linux x86_64 (gcc 16.1.0 and llvm 23.1.3, dev and release) and on aarch64
under qemu. The Windows and macOS builds are cross-linked from Linux.- What mcpp-language-server's operating-system layer carried (its
modules/osandmodules/platform, removed in its 0.0.18):process::run(options, bounds, input): a run with a hard bound, a grace
and a drain, and limits on what each output keeps. It reports a timeout,
an output a descendant held open, and an output it cut.process::threads(id): the threads of a program and the processor time of
each (Linux; none elsewhere).env::assignments(entries):NAME=valueentries as the overrides of a
started program's environment.fs::read(file, at_most): a bounded read,errc::too_largepast the
bound (new error condition).fs::canonical(name): the name a node is known by, with links followed
and, on Windows, short (8.3) components replaced by their long names.
- Tests:
platform_testasserts that Linux names the machine as the processor
the program runs on.fs_testasserts that a volume's kind is named.
process_testmakes a file executable withos::fs::set_executablerather
than withstd::filesystem::permissions, which a C library on openkal
refuses.process_testcovers the bounded run (a cut output, a hard bound,
an output held open), the threads of this program and environment entries;
fs_testcovers the bounded read and the canonical name.
os 0.2.0
exec; both outputs on one pipe; appending and durability; measured volumes; place and exchange; owners, processors and available memory; a bounded read of input; output sent to the error stream; raw mode that keeps the interrupt; Windows facts. Over openkal 0.17.1 (openkal-linux 0.18.2, openkal-macos 0.15.1, openkal-windows 0.13.3); ok images over openkal-llvm-runtime 0.16.3 and openkal-tools 0.1.1 (#3).
mcpplibs.os 0.1.1
mcpplibs.os 0.1.1 is a patch release of 0.1.0. Names now reach the system as UTF-8 and come back as UTF-8 on every host, never through the process's code page (README rule R7).
On Windows (MSVC), path::string(), path::generic_string() and path(std::string) use the ANSI code page:
- A name the code page cannot spell threw, and inside the library that ended the program (0xC0000409).
- A name the code page can spell reached openkal-windows as ANSI bytes, but openkal reads names as UTF-8, so the file opened was the wrong one.
0.1.1 adds os::fs::utf8, generic_utf8 and from_utf8, and every name in fs, process, env, dirs, ipc and the Windows module now goes through them. fs_test writes, reads, replaces and renames a file whose directory and name are in four scripts. POSIX behaviour is unchanged.
[dependencies]
mcpplibs.os = "0.1.1"mcpplibs.os 0.1.0
mcpplibs.os 0.1.0 is a C++ operating-system library over openkal 0.17. openkal provides the kernel ABI as small, composable atoms. mcpplibs.os composes them and adds the conventions each system follows. A program built for a system reads that system's platform constants at compile time. A program built as an ok image (<arch>-openkal) learns its host at load through host().
| Module | Contents |
|---|---|
mcpplibs.os.platform |
PLATFORM, ARCH, is_linux / is_macos / is_windows / is_posix, exe_suffix, path_list_separator, host() |
mcpplibs.os.error |
errc (openkal's closed set of conditions), error, result<T> |
mcpplibs.os.env |
variables (case-insensitive names on Windows), arguments, the program's own image, directory lists (split_list, join_list), PATH search with PATHEXT |
mcpplibs.os.fs |
write_atomic, publish (no replace), caps, lock, links, set_executable, stamp_of, identity_of, locate, absolute, names_a_place; host naming rules: generic, native, is_absolute, same, within |
mcpplibs.os.process |
spawn, run, pipes, units and end_unit, bound lifetime, bounded waits and reads, self, describe, alive |
mcpplibs.os.interrupt |
requested, wait, end_as_requested |
mcpplibs.os.stdio |
the three streams as bytes |
mcpplibs.os.terminal |
interactive, size, sequences, color, raw_mode |
mcpplibs.os.dirs |
home, config, data, state, cache, runtime, temp |
mcpplibs.os.ipc |
a listener and a connection at a name in a directory, single_instance |
mcpplibs.os.net |
loopback TCP |
mcpplibs.os.machine |
the machine's architecture (seen through Rosetta and WoW64), memory |
mcpplibs.os.random |
bytes from the system's source of unpredictable bytes, hex |
mcpplibs.os.linux / .macos / .windows / .posix |
platform modules; every target declares them, and each is defined only on its own system |
Dependencies: openkal 0.17.0, plus the implementation for the target system (openkal-linux 0.18.0, openkal-macos 0.15.0 or openkal-windows 0.13.0). Builds of ok images also use openkal-llvm-runtime 0.16.0 and openkal-tools 0.1.0.
Use:
[dependencies.mcpplibs]
os = "0.1.0"