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 / files.om

74 lines · 1034 bytes Raw Blame History
1note Native host file and monotonic clock checks. Paths belong to the gate's isolated working directory.
2text path "probe.bin"
3text data "Omega host test\n"
4global bytes uchar 32
5fn main to int
6if lt realns 1700000000000000000
7ret 16
8end
9start = monons
10if lt start 0
11ret 1
12end
13fd = fopen path 0 len path 194 384
14if lt fd 0
15ret 2
16end
17dup = fopen path 0 len path 194 384
18if ne dup neg long 17
19ret 3
20end
21n = write int fd data 0 len data
22if ne n long len data
23ret 4
24end
25r = fsync int fd
26if ne r 0
27ret 5
28end
29r = fchmod int fd 256
30if ne r 0
31ret 6
32end
33r = fseek int fd 0 0
34if ne r 0
35ret 7
36end
37n = read int fd bytes 0 len bytes
38if ne n long len data
39ret 8
40end
41for i ulong len data
42if ne get bytes i get data i
43ret 9
44end
45end
46r = fclose int fd
47if ne r 0
48ret 10
49end
50r = fclose int fd
51if ne r neg long 9
52ret 11
53end
54r = unlink path 0 len path
55if ne r 0
56ret 12
57end
58r = fopen path 0 len path 0 0
59if ne r neg long 2
60ret 13
61end
62last = start
63for i ulong 10000
64now = monons
65if lt now last
66ret 14
67end
68last = now
69end
70if le last start
71ret 15
72end
73ret 0
74end