Initial commit of NetBSD port

This commit is contained in:
Andreas T Jonsson
2024-04-16 14:27:29 +02:00
parent 97db075e45
commit 4558f3992a
20 changed files with 1154 additions and 17 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
//+build linux, darwin, freebsd, openbsd, haiku
//+build linux, darwin, freebsd, openbsd, netbsd, haiku
package unix
when ODIN_OS == .Darwin {
@@ -65,7 +65,8 @@ seconds_since_boot :: proc "c" () -> f64 {
return f64(ts_boottime.tv_sec) + f64(ts_boottime.tv_nsec) / 1e9
}
// TODO(phix): 'nanosleep' here might refere to the wrong version on NetBSD. Need to investigate this further.
// Normally this is solved by just including 'time.h'. So I need to understand the macro-magic going on in there.
inline_nanosleep :: proc "c" (nanoseconds: i64) -> (remaining: timespec, res: i32) {
s, ns := nanoseconds / 1e9, nanoseconds % 1e9
requested := timespec{tv_sec=s, tv_nsec=ns}