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 / omc / sites / found-elemtype-1.om

38 lines · 744 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program; reaches the omc error site in elemtype (code 9)
2note chmod: path permissions through fchmodat; mode 0600 is 384, checked in st_mode at byte 16.
3text p "mode.tmp"
4text miss "no.such.file"
5fn main to int
6fd = int fopen p 0 len p 578 420
7if lt fd 0
8ret 1
9end
10r = fclose fd
11if ne r 0
12ret 2
13end
14r = chmod p 0 len p 384
15if ne r 0
16ret 3
17end
18buf = new bool 128 0
19r = stat p 0 len p buf 0 128
20if ne r 0
21ret 4
22end
23m = add ulong get buf 16 shl ulong get buf 17 ulong 8
24m = add m shl ulong get buf 18 ulong 16
25m = add m shl ulong get buf 19 ulong 24
26if ne and m ulong 4095 ulong 384
27ret 5
28end
29r = chmod miss 0 len miss 384
30if ge r 0
31ret 6
32end
33r = unlink p 0 len p
34if ne r 0
35ret 7
36end
37ret 0
38end