mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Implement POSIX pthread, signal, sys/resource, unistd for Linux.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user