commit to merge upstream/master

This commit is contained in:
CiD-
2022-03-14 13:34:06 -04:00
parent e008b5a160
commit c293e88f2e
5 changed files with 129 additions and 92 deletions
+9 -1
View File
@@ -1717,7 +1717,7 @@ sys_rmdir :: proc(path: cstring) -> int {
}
}
sys_mkdir :: proc(path: cstring, mode: u32 = 0o775) -> int {
sys_mkdir :: proc(path: cstring, mode: int) -> int {
when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(SYS_mkdir, uintptr(rawptr(path)), uintptr(mode)))
} else { // NOTE: arm64 does not have mkdir
@@ -1725,6 +1725,14 @@ sys_mkdir :: proc(path: cstring, mode: u32 = 0o775) -> int {
}
}
sys_mknod :: proc(path: cstring, mode: int, dev: int) -> int {
when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(SYS_mknod, uintptr(rawptr(path)), uintptr(mode), uintptr(dev)))
} else { // NOTE: arm64 does not have mknod
return int(intrinsics.syscall(SYS_mknodat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(mode), uintptr(dev)))
}
}
sys_truncate :: proc(path: cstring, length: i64) -> int {
when ODIN_ARCH == .amd64 || ODIN_ARCH == .arm64 {
return int(intrinsics.syscall(SYS_truncate, uintptr(rawptr(path)), uintptr(length)))