interplane.Get Omega
Read in your language

spark-connector

aien-dev/spark-connector

Brought by drakestapleton

branch main Branches Tags History

spark-connector / gates / hostile / fork.om

24 lines · 388 bytes Raw Blame History
1note hostile probe: try to start 50 processes; prints how many forks succeeded
2text m1 "forks "
3text nl "\n"
4fn main to int
5d = new uchar 24 0
6ok = ulong 0
7for i ulong 50
8r = fork
9if eq r 0
10exit 0
11end
12if gt r 0
13ok = add ok 1
14end
15end
16k = write 1 m1 0 len m1
17v = ok
18n = ulong 0
19put d 0 uchar add 48 div v 10
20put d 1 uchar add 48 rem v 10
21k = write 1 d 0 2
22k = write 1 nl 0 len nl
23ret 0
24end