mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
os2 tests
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
//+private
|
||||
package os2
|
||||
|
||||
import "core:sys/unix"
|
||||
|
||||
EPERM :: 1
|
||||
ENOENT :: 2
|
||||
ESRCH :: 3
|
||||
@@ -126,6 +128,15 @@ ENOTRECOVERABLE:: 131 /* State not recoverable */
|
||||
ERFKILL :: 132 /* Operation not possible due to RF-kill */
|
||||
EHWPOISON :: 133 /* Memory page has hardware error */
|
||||
|
||||
_get_platform_error :: proc(res: int) -> Error {
|
||||
errno := unix.get_errno(res)
|
||||
return Platform_Error{i32(errno)}
|
||||
}
|
||||
|
||||
_ok_or_error :: proc(res: int) -> Error {
|
||||
return res >= 0 ? nil : _get_platform_error(res)
|
||||
}
|
||||
|
||||
_error_string :: proc(errno: i32) -> string {
|
||||
if errno == 0 {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user