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

26 lines · 436 bytes Raw Blame History
1note process groups: setsid succeeds or returns EPERM when already a leader; on success the new
2note group id must be the pid. setpgid(0,0) may succeed or return EPERM depending on that state.
3fn main to int
4i = getpgid 0
5if le i long 0
6ret 1
7end
8s = setsid
9if and lt s 0 ne s long -1
10ret 2
11end
12q = getpgid 0
13if le q long 0
14ret 3
15end
16if ge s 0
17if ne q getpid
18ret 4
19end
20end
21r = setpgid 0 0
22if and ne r 0 ne r long -1
23ret 5
24end
25ret 0
26end