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 / tests / chown.om

32 lines · 517 bytes Raw Blame History
1note chown: fchownat to the current uid (gid unchanged); st_uid low byte at 24, missing path errno.
2text p "own.tmp"
3text miss "no.such.file"
4fn main to int
5fd = int fopen p 0 len p 578 420
6if lt fd 0
7ret 1
8end
9r = fclose fd
10u = getuid
11r = chown p 0 len p int u int -1
12if ne r 0
13ret 2
14end
15st = new uchar 128 0
16r = stat p 0 len p st 0 128
17if ne r 0
18ret 3
19end
20if ne int get st 24 int and u long 255
21ret 4
22end
23r = chown miss 0 len miss int u int -1
24if ge r 0
25ret 5
26end
27r = unlink p 0 len p
28if ne r 0
29ret 6
30end
31ret 0
32end