Report Invalid_Whence on some os platforms

- Move `Seek`-related checks into OS-specific files for granularity.

Platforms:
- Darwin
- FreeBSD
- Haiku
- Linux
- NetBSD
- OpenBSD
This commit is contained in:
Feoramund
2024-08-28 19:53:20 +02:00
committed by Laytan
parent 0243647e15
commit 6aedb2695a
7 changed files with 73 additions and 14 deletions
-8
View File
@@ -47,14 +47,6 @@ _file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte,
}
case .Seek:
n, os_err = seek(fd, offset, int(whence))
if os_err != nil {
switch whence {
case .Start, .Current, .End:
return 0, .Invalid_Offset
case:
return 0, .Invalid_Whence
}
}
case .Size:
n, os_err = file_size(fd)
case .Destroy: