// SPDX-License-Identifier: Apache-2.0 // SchOS — first-party userland runtime: _start entry and exit. #include "types.h" #include "user.h" extern void _xv6_exit(void); void exit(void) { _xv6_exit(); for (;;); } /* _start lives in lib/start.S — it must read incoming registers, which * cannot be expressed portably in C. See that file. */ void __stack_chk_fail(void) { _xv6_exit(); for (;;); } // exec() without an environment. // // The syscall is execve, three arguments, because that is what Linux numbers // 59 and what musl calls. The two-argument spelling stays because most of // cmd/ has no environment to pass and should not have to say so -- but it // says so *here*, explicitly, rather than leaving %rdx to chance. int exec(char *path, char **argv) { return execve(path, argv, 0); }