Simplified standard library
This commit is contained in:
55
lib/sys/sys_mac.q
Normal file
55
lib/sys/sys_mac.q
Normal file
@ -0,0 +1,55 @@
|
||||
read(fd int, buffer *any, length int) -> int {
|
||||
return syscall(0x2000003, fd, buffer, length)
|
||||
}
|
||||
|
||||
write(fd int, buffer *any, length int) -> int {
|
||||
return syscall(0x2000004, fd, buffer, length)
|
||||
}
|
||||
|
||||
open(path *any, flags int, mode int) -> int {
|
||||
return syscall(0x2000005, path, flags, mode)
|
||||
}
|
||||
|
||||
close(fd int) -> int {
|
||||
return syscall(0x2000006, fd)
|
||||
}
|
||||
|
||||
mmap(address int, length int, protection int, flags int) -> *any {
|
||||
return syscall(0x20000C5, address, length, protection, flags)
|
||||
}
|
||||
|
||||
munmap(address *any, length int) -> int {
|
||||
return syscall(0x2000049, address, length)
|
||||
}
|
||||
|
||||
exit(status int) {
|
||||
syscall(0x2000001, status)
|
||||
}
|
||||
|
||||
fork() -> int {
|
||||
return syscall(0x2000002)
|
||||
}
|
||||
|
||||
execve(path *any, argv *any, envp *any) -> int {
|
||||
return syscall(0x200003B, path, argv, envp)
|
||||
}
|
||||
|
||||
waitid(type int, id int, info *any, options int) -> int {
|
||||
return syscall(0x20000AD, type, id, info, options)
|
||||
}
|
||||
|
||||
socket(family int, type int, protocol int) -> int {
|
||||
return syscall(0x2000061, family, type, protocol)
|
||||
}
|
||||
|
||||
accept(fd int, address *any, length int) -> int {
|
||||
return syscall(0x200001E, fd, address, length)
|
||||
}
|
||||
|
||||
bind(fd int, address *sockaddr_in_bsd, length int) -> int {
|
||||
return syscall(0x2000068, fd, address, length)
|
||||
}
|
||||
|
||||
listen(fd int, backlog int) -> int {
|
||||
return syscall(0x200006A, fd, backlog)
|
||||
}
|
Reference in New Issue
Block a user