Implement POSIX pthread, signal, sys/resource, unistd for Linux.

This commit is contained in:
Isaac Andrade
2024-09-21 20:44:33 -06:00
parent 97e06cb98e
commit 10702f1134
4 changed files with 438 additions and 64 deletions
+39
View File
@@ -513,6 +513,45 @@ when ODIN_OS == .Darwin {
sched_priority: c.int, /* [PSX] process or thread execution scheduling priority */
}
} else when ODIN_OS == .Linux {
PTHREAD_CANCEL_DEFERRED :: 0
PTHREAD_CANCEL_ASYNCHRONOUS :: 1
PTHREAD_CANCEL_ENABLE :: 0
PTHREAD_CANCEL_DISABLE :: 1
PTHREAD_CANCELED :: rawptr(uintptr(-1))
PTHREAD_CREATE_JOINABLE :: 0
PTHREAD_CREATE_DETACHED :: 1
PTHREAD_INHERIT_SCHED :: 0
PTHREAD_EXPLICIT_SCHED :: 1
PTHREAD_PRIO_NONE :: 0
PTHREAD_PRIO_INHERIT :: 1
PTHREAD_PRIO_PROTECT :: 2
PTHREAD_PROCESS_PRIVATE :: 0
PTHREAD_PROCESS_SHARED :: 1
PTHREAD_SCOPE_SYSTEM :: 0
PTHREAD_SCOPE_PROCESS :: 1
pthread_t :: distinct c.ulong
pthread_attr_t :: struct #raw_union {
__size: [56]c.char,
__align: c.long,
}
pthread_key_t :: distinct c.uint
sched_param :: struct {
sched_priority: c.int, /* [PSX] process or thread execution scheduling priority */
}
} else {
#panic("posix is unimplemented for the current target")
}