mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -501,11 +501,13 @@ seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Errno) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_size :: proc(fd: Handle) -> (i64, Errno) {
|
file_size :: proc(fd: Handle) -> (i64, Errno) {
|
||||||
s, err := _fstat(fd)
|
// deliberately uninitialized; the syscall fills this buffer for us
|
||||||
if err != ERROR_NONE {
|
s: OS_Stat = ---
|
||||||
return 0, err
|
result := _unix_fstat(fd, &s)
|
||||||
}
|
if result < 0 {
|
||||||
return max(s.size, 0), ERROR_NONE
|
return 0, _get_errno(result)
|
||||||
|
}
|
||||||
|
return max(s.size, 0), ERROR_NONE
|
||||||
}
|
}
|
||||||
|
|
||||||
rename :: proc(old_path, new_path: string) -> Errno {
|
rename :: proc(old_path, new_path: string) -> Errno {
|
||||||
|
|||||||
Reference in New Issue
Block a user