interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / host / prlimit

a64f6be omc: arena accesses inline, in range by construction; compile time back at or below f4fa7951 Drake Stapleton committed 2026-11-11
..
mutants/
README.md2493
contract.om206
efi-target.om14
fnmode.om179
longpid.om178
prlimit.cases2537
prlimit.om8297
read16.om194
textarr.om191
x86-target.om16

README.md

prlimit (keyword 235)

prlimit pid res A off n returns long: 0 or a negative errno from Linux prlimit64 (AArch64 syscall 261, x86-64 syscall 302).

operandtypemeaning
pidinttarget process; 0 is the caller
resintRLIMIT_* number (7 NOFILE, 9 AS, ...)
Awritable byte arraylimit buffer; a text is error 20
off, nulongslice A[off..off+n), checked first (trap 3)
  • n 16 reads: new = NULL, the old {rlim_cur, rlim_max} lands in A[off..off+16) as two little-endian u64.
  • n 32 sets: the new pair is read from A[off..off+16), the old pair is written to A[off+16..off+32).
  • any other n: -22 with no kernel call.
  • with n 32 the kernel itself also returns -22 (EINVAL) when the new soft value is above the new hard value; that -22 does not mean a bad n.

Program mode only: function mode is error 9, a contract clause error 30, target x86efi error 25. Limits are inherited by fork and kept across execprog.

Gate

prlimit.cases, run by the OM-2 conductor from seed/host/check.sh: OM2GATE PASS cases=15.

  • fixture: prlimit.om on AArch64, all 16 checks against /proc/self/limits (read, set soft NOFILE 40, EMFILE at fd 40, restore, -22 for bad n and resource, -3 ESRCH, -1 EPERM on pid 1 unless root, RLIMIT_AS read, trap 3 on both slice shapes, read and set at the unaligned offset 9, RLIMIT_AS 1 GiB seen after execprog, a 128 MiB image killed under a 64 MiB cap, the same image running uncapped).
  • x86-fixture: x86-target.om+prlimit.om with argument noas (checks 1-12 and 16; qemu-user ignores RLIMIT_AS writes). It runs through binfmt qemu-x86_64: emulator evidence, not hardware qualification.
  • refusals: fnmode.om (9), contract.om (30), textarr.om (20), longpid.om (7), efi-target.om+read16.om (25), x86 fnmode.om (9).
  • mutants: each mutants/NAME.from occurs once in seed/omc/omc.om and is replaced by NAME.to; the fixture built by that compiler must fail at the named check (exit = check number).
mutantchangefixture exit
a64-sysnohsys 261 to 163 (getrlimit)1
a64-swapn 32 passes new = A+16, old = A3
a64-nguardthe n == 32 test always taken7
x86-sysnoxhcall 302 to 97 (getrlimit)1
x86-swapn 32 passes rdx = A+163
x86-nguardthe n == 32 test always taken7
a64-nooffoff not added to the base (kernel gets &A[0])16