get .MODE and .TYPE right

This commit is contained in:
jason
2026-05-12 18:53:39 -04:00
parent bb9cddabac
commit 57b63263b3
3 changed files with 3 additions and 3 deletions

View File

@@ -98,7 +98,7 @@ _read_directory_iterator_init :: proc(it: ^Read_Directory_Iterator, f: ^File) {
}
stat: linux.Statx
errno := linux.statx(linux.Fd(fd(f)), "", {.EMPTY_PATH}, {.MODE}, &stat)
errno := linux.statx(linux.Fd(fd(f)), "", {.EMPTY_PATH}, {.TYPE}, &stat)
if errno != .NONE {
read_directory_iterator_set_error(it, name(f), _get_platform_error(errno))
return

View File

@@ -280,7 +280,7 @@ _write_at :: proc(f: ^File_Impl, p: []byte, offset: i64) -> (nt: i64, err: Error
@(no_sanitize_memory)
_file_size :: proc(f: ^File_Impl) -> (n: i64, err: Error) {
s: linux.Statx = ---
errno := linux.statx(f.fd, "", {.EMPTY_PATH}, {.SIZE, .MODE}, &s)
errno := linux.statx(f.fd, "", {.EMPTY_PATH}, {.SIZE, .TYPE}, &s)
if errno != .NONE {
return 0, _get_platform_error(errno)
}

View File

@@ -439,7 +439,7 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
exe_path = strings.to_cstring(&exe_builder) or_return
stat: linux.Statx
if linux.statx(linux.AT_FDCWD, exe_path, {}, {.MODE}, &stat) == .NONE && .IFREG in stat.mode && .IXUSR in stat.mode {
if linux.statx(linux.AT_FDCWD, exe_path, {}, {.TYPE, .MODE}, &stat) == .NONE && .IFREG in stat.mode && .IXUSR in stat.mode {
found = true
break
}