@@ -14,7 +14,7 @@ foreign libc {
_stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) {
ret := _unix_write(2, raw_data(data), len(data))
if ret < len(data) {
- err := __error()
+ err := __errnop()
return int(ret), _OS_Errno(err^ if err != nil else 0)
}
return int(ret), 0
@@ -45,7 +45,7 @@ when ODIN_OS == .Windows {
-when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD {
+when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD || ODIN_OS == .Haiku {
@(default_calling_convention="c")
foreign libc {
// 7.27.2 Time manipulation functions
@@ -0,0 +1,20 @@
+package os
+
+foreign import libc "system:c"
+import "core:strings"
+import "core:c"
+import "base:runtime"
+Handle :: distinct i32
+Pid :: distinct i32
+File_Time :: distinct i64
+Errno :: distinct i32
+B_GENERAL_ERROR_BASE :: min(i32)
+B_POSIX_ERROR_BASE :: B_GENERAL_ERROR_BASE + 0x7000
+INVALID_HANDLE :: ~Handle(0)
+ERROR_NONE: Errno: 0
@@ -1,5 +1,5 @@
//+private
-//+build linux, darwin, freebsd, openbsd
+//+build linux, darwin, freebsd, openbsd, haiku
package time
import "core:sys/unix"