23 lines
352 B
Plaintext
Raw Normal View History

import mem
import sys
main() {
start()
start()
start()
thread()
}
start() {
size := 4096
stack := mem.alloc(size)
pointer := stack + size - 8
store(pointer, 8, thread)
sys.clone(0x100 | 0x200 | 0x400 | 0x800 | 0x8000 | 0x10000 | 0x80000000, pointer)
}
thread() {
sys.write(1, "[ ] start\n", 10)
sys.write(1, "[x] end\n", 8)
sys.exit(0)
}