POSIX is implemented by TMK libc plus user-space servers. Kernel system calls are not POSIX calls.
Compatibility means applications can be recompiled from source against TMK headers and libc and observe the documented POSIX.1-2024 semantics. It does not mean Linux binaries run unchanged.
The libc baseline is a pinned musl port with a TMK-native syscall/service backend. Musl is user-space code and is not added to the kernel isolation TCB.
- static ELF64 loading;
_exit, basic process identity,writeto console;- anonymous memory allocation;
- monotonic time and sleep;
- minimal directory/file read from initramfs.
fork,execve,posix_spawn,waitpid, process groups, sessions;- credentials and basic owner/group/mode checks;
- signals required by the shell and ordinary utilities;
- file descriptor/open-file-description semantics;
- regular files, directories, symlinks, pipes, terminal devices;
openat,close,read,write,pread,pwrite,lseek;fstatat,mkdirat,unlinkat,renameat,linkat,symlinkat;dup,dup2,fcntl,pipe,poll;fsync,fdatasync,sync;mmap,munmap,mprotect,brk;- clocks, timers, and sleep;
- IPv4 ICMP/UDP/TCP sockets; and
- a shell and core utilities sufficient for the acceptance scenario.
- pthreads and process-shared synchronization;
- complete multi-threaded signal semantics;
- dynamic linking;
- UNIX-domain sockets and descriptor passing;
- asynchronous I/O;
- POSIX shared-memory and semaphore objects;
- IPv6;
- locale expansion; and
- additional POSIX option groups selected by a conformance profile.
No document or header may advertise P2 support while only P1 is implemented.
| POSIX concept | Owning component |
|---|---|
| PID, parent/child, credentials, session, signals | procd |
address spaces, COW, ELF, mmap |
pagerd |
| file descriptor table and open file descriptions | vfsd |
| path namespace, permissions, pipes | vfsd |
| persistent inode/data operations | tmfsd |
| sockets and protocol state | netd |
| terminal sessions and line discipline | termd |
| monotonic primitive | kernel timer |
| realtime clock policy | timed |
| libc buffering, TLS, cancellation | libc |
Kernel capability badges authenticate callers to servers. Servers do not trust a PID supplied in an RPC payload.
procd owns a Process record:
- PID generation and parent;
- credentials;
- process group/session;
- child and wait status;
- signal dispositions and pending sets;
- references to kernel quota domain, VSpace, CSpace, threads, descriptor table, and current directory;
- resource limits; and
- lifecycle state.
PIDs are POSIX names, not authorization handles. Internal references include a generation so PID reuse cannot confuse late messages.
P1 fork supports a single-threaded caller. It:
- quiesces the process at a libc safe point;
- asks
procdto reserve child identity and resources; - asks
pagerdto construct parent/child COW mappings; - clones descriptor-table references so open file descriptions remain shared;
- clones signal dispositions and credentials according to POSIX rules;
- creates a child thread with copied register/TLS state and zero return value;
- commits both service transactions; and
- rolls back all reservations on pre-commit failure.
P2 implements POSIX multi-threaded fork, where only the calling thread appears
in the child, plus pthread_atfork behavior.
execve is transactional:
pagerdvalidates and stages the ELF image, stack, TLS, and arguments;procdchecks credentials and serializes process state;vfsdapplies close-on-exec;- signal dispositions reset as specified; and
- the old VSpace is replaced only after the new image is ready.
Failure leaves the old process image running. Success does not return.
Each process has a descriptor table mapping small integers to references and descriptor flags. An open file description is a separate server object holding:
- target object;
- current offset;
- status flags;
- access mode;
- reference count; and
- advisory/record-lock state where supported.
dup and fork share the open file description, including its offset. Separate
open calls receive distinct descriptions. Descriptor and description locking
must preserve atomic offset update for read/write.
P1 provides:
- one rooted namespace with mount points;
.and..;- hard links, symlinks, link counts;
- owner/group/mode access checks;
- atomic rename within one filesystem;
- unlink-while-open;
- per-open offsets;
- durable
fsync/fdatasync; - stable inode identity during one mount; and
- documented timestamp resolution.
Path traversal is entirely in vfsd using directory capabilities returned by
filesystem servers. RPCs pass (directory_handle, component) rather than an
unchecked full path, preventing confused-deputy traversal.
The first release does not claim ACLs, extended attributes, quotas exposed through POSIX, or cross-filesystem atomic rename.
procd owns signal policy; the kernel supplies thread suspension, fault delivery,
notifications, and register update.
P1 supports the signal set needed by the shell and standard process control,
including SIGCHLD, SIGINT, SIGTERM, SIGKILL, SIGSTOP, SIGCONT,
SIGPIPE, synchronous fault signals, and timer signals.
Delivery:
procdselects an eligible thread and disposition;pagerd/libc validate a writable signal frame and trampoline;- the kernel installs validated user registers through a fault/control capability;
sigreturnvalidates the entire restored frame; and- unmaskable signals cannot be caught or blocked.
A malformed signal frame terminates the process. It cannot install kernel selectors, noncanonical addresses, or privileged flags.
P2 maps each pthread to a kernel thread. Uncontended mutexes and atomics remain
user-local. Contended waits use a versioned syncd protocol:
- client atomically records a wait sequence;
syncdqueues by(process_generation, user_key, sequence);- unlock/wake is idempotent;
- sequence comparison prevents lost wakeups; and
- priority-sensitive waits use an IPC endpoint so kernel donation applies.
Robust mutex owner death is reported when procd observes thread termination.
The kernel provides monotonic deadlines and nanosecond conversion. timed
maintains realtime offset and adjustment policy.
CLOCK_MONOTONICnever moves backward.CLOCK_REALTIMEmay be set by authorized policy.- relative sleep uses monotonic deadlines.
- timeout RPCs include absolute monotonic deadlines to avoid restart extension.
netd owns POSIX socket objects. P1 supports:
- IPv4 datagram and stream sockets;
bind,connect,listen,accept;send,sendto,recv,recvfrom;shutdown;- nonblocking mode;
poll;- basic socket options; and
- ICMP echo used by
ping.
Data uses shared frame rings for large transfers and IPC fast words for control. Network names and DNS are an optional user-space resolver; acceptance can use a literal host address.
termd provides canonical/raw modes, foreground process groups, echo, and control
character to signal translation. The shell uses ordinary POSIX process, pipe,
descriptor, and signal interfaces; it does not receive special kernel privileges.
The repository maintains a generated matrix for every advertised interface:
- POSIX reference section;
- profile stage;
- implementation owner;
- supported flags/options;
- required error cases;
- semantic tests;
- known deviations; and
- assurance level.
The image exposes the same matrix through sysconf/documentation. A full
POSIX.1-2024 conformance claim requires completion of the selected option groups
and an external conformance campaign; P1 alone is called “the TMK P1 POSIX
profile,” not “fully POSIX compliant.”