Reorganized sys functions

This commit is contained in:
2025-02-06 13:46:37 +01:00
parent 170931cf5d
commit 9dcd43be46
15 changed files with 110 additions and 120 deletions

View File

@ -1,71 +0,0 @@
read(fd Int, address Pointer, length Int) -> Int {
return syscall(0, fd, address, length)
}
write(fd Int, address Pointer, length Int) -> Int {
return syscall(1, fd, address, length)
}
open(file Pointer, flags Int, mode Int) -> Int {
return syscall(2, file, flags, mode)
}
close(fd Int) -> Int {
return syscall(3, fd)
}
mmap(address Int, length Int, protection Int, flags Int) -> Pointer {
return syscall(9, address, length, protection, flags)
}
munmap(address Pointer, length Int) -> Int {
return syscall(11, address, length)
}
nanosleep(duration Pointer) -> Int {
return syscall(35, duration, 0)
}
clone(flags Int, stack Pointer) -> Int {
return syscall(56, flags, stack)
}
fork() -> Int {
return syscall(57)
}
execve(path Pointer, argv Pointer, envp Pointer) -> Int {
return syscall(59, path, argv, envp)
}
exit(status Int) {
syscall(60, status)
}
getcwd(buffer Pointer, length Int) -> Int {
return syscall(79, buffer, length)
}
chdir(path Pointer) -> Int {
return syscall(80, path)
}
rename(old Pointer, new Pointer) -> Int {
return syscall(82, old, new)
}
mkdir(path Pointer, mode Int) -> Int {
return syscall(83, path, mode)
}
rmdir(path Pointer) -> Int {
return syscall(84, path)
}
unlink(file Pointer) -> Int {
return syscall(87, file)
}
waitid(type Int, id Int, info Pointer, options Int) -> Int {
return syscall(247, type, id, info, options)
}