omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
omega-mcp / data / examples / limits.om
| 1 | note prlimit reads and sets the open-file limit (res 7); a failed execenv (no such file) returns -2 |
| 2 | global lim uchar 32 |
| 3 | fn ck yes bool to void |
| 4 | if not yes |
| 5 | exit 80 |
| 6 | end |
| 7 | end |
| 8 | fn main to int |
| 9 | ck eq prlimit 0 7 lim 0 16 0 |
| 10 | ck eq prlimit 0 7 lim 0 8 neg long 22 |
| 11 | ck eq prlimit 0 7 lim 0 32 0 |
| 12 | for i ulong 16 |
| 13 | ck eq get lim i get lim add i 16 |
| 14 | end |
| 15 | x = new uchar 6 0 |
| 16 | put x 0 1 |
| 17 | put x 2 2 |
| 18 | put x 4 47 |
| 19 | put x 5 120 |
| 20 | e = new uchar 7 0 |
| 21 | put e 0 1 |
| 22 | put e 2 3 |
| 23 | put e 4 97 |
| 24 | put e 5 61 |
| 25 | put e 6 98 |
| 26 | ck eq execenv x 0 6 e 0 7 neg long 2 |
| 27 | ret 0 |
| 28 | end |