Added conditional compilation for each OS
This commit is contained in:
71
lib/sys/sys_linux.q
Normal file
71
lib/sys/sys_linux.q
Normal file
@ -0,0 +1,71 @@
|
||||
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)
|
||||
}
|
||||
|
||||
clone(flags Int, stack Pointer) -> Int {
|
||||
return syscall(56, flags, stack)
|
||||
}
|
||||
|
||||
exit(status Int) {
|
||||
syscall(60, status)
|
||||
}
|
||||
|
||||
socket(family Int, type Int, protocol Int) -> Int {
|
||||
return syscall(41, family, type, protocol)
|
||||
}
|
||||
|
||||
accept(fd Int, address Pointer, length Int) -> Int {
|
||||
return syscall(43, fd, address, length)
|
||||
}
|
||||
|
||||
bind(fd Int, address Pointer, length Int) -> Int {
|
||||
return syscall(49, fd, address, length)
|
||||
}
|
||||
|
||||
listen(fd Int, backlog Int) -> Int {
|
||||
return syscall(50, fd, backlog)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user