Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334import cimport runrun(path string) -> error { pid := fork() if pid == 0 { cpath := c.string(path) argv := new(Argv) argv.path = cpath.ptr err := execve(cpath.ptr, argv, 0) delete(argv) delete(cpath) run.exit(err) } status := new(int32) result := wait4(pid, status, 0, 0) if result < 0 { return result } exitCode := ([status] >> 8) & 0xFF return exitCode}execve(path *byte, argv *any, envp *any|nil) -> error { return syscall(_execve, path, argv, envp)}wait4(pid int, status *int32, options int, rusage *any|nil) -> error { return syscall(_wait4, pid, status, options, rusage)}