Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/omc/om2/fnhost/ok.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / om2 / fnhost / ok.om` 34 lines ยท 717 bytes Raw Blame History 1 note ok.om: an OM-2 function unit (no fn main) using every function-mode host word: getuid geteuid 2 note getgid getegid, stat lstat fopen fstat fclose, and read. Compiles (exit 0) since the om2 function-mode 3 note host-word subset; the same unit without the om2 line is error 9 (om1.om). 4 om2 5 fn ids to ulong 6 a = ulong getuid 7 b = ulong geteuid 8 c = ulong getgid 9 e = ulong getegid 10 ret add add a b add c e 11 end 12 fn peek p view uchar * to long 13 s = new uchar 128 0 14 r = lstat p 0 len p s 0 128 15 if ne r 0 16 ret r 17 end 18 r = stat p 0 len p s 0 128 19 if ne r 0 20 ret r 21 end 22 fd = fopen p 0 len p 559104 0 23 if lt fd 0 24 ret fd 25 end 26 b = new uchar 16 0 27 k = fstat int fd s 0 128 28 n = read int fd b 0 16 29 z = fclose int fd 30 if ne k 0 31 ret k 32 end 33 ret n 34 end