Use fstat on os2.File directly

This commit is contained in:
gingerBill
2024-07-14 14:51:22 +01:00
parent d1450e3d88
commit 3d38f14202
5 changed files with 19 additions and 19 deletions
+10 -15
View File
@@ -90,22 +90,17 @@ _open :: proc(name: string, flags: File_Flags, perm: File_Mode) -> (f: ^File, er
_new_file :: proc(fd: uintptr, _: string = "") -> ^File {
file := new(File, file_allocator())
_construct_file(file, fd, "")
return file
}
_construct_file :: proc(file: ^File, fd: uintptr, _: string = "") {
file^ = {
impl = {
fd = linux.Fd(fd),
allocator = file_allocator(),
name = _get_full_path(file.impl.fd, file.impl.allocator),
},
stream = {
data = file,
procedure = _file_stream_proc,
},
file.impl = {
fd = linux.Fd(fd),
allocator = file_allocator(),
name = _get_full_path(file.impl.fd, file.impl.allocator),
}
file.stream = {
data = file,
procedure = _file_stream_proc,
}
file.fstat = _fstat
return file
}
_destroy :: proc(f: ^File) -> Error {