mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 16:48:18 +00:00
add get thread count to openbsd
This commit is contained in:
@@ -269,6 +269,7 @@ foreign libc {
|
|||||||
@(link_name="mkdir") _unix_mkdir :: proc(path: cstring, mode: mode_t) -> c.int ---
|
@(link_name="mkdir") _unix_mkdir :: proc(path: cstring, mode: mode_t) -> c.int ---
|
||||||
|
|
||||||
@(link_name="getpagesize") _unix_getpagesize :: proc() -> c.int ---
|
@(link_name="getpagesize") _unix_getpagesize :: proc() -> c.int ---
|
||||||
|
@(link_name="sysconf") _sysconf :: proc(name: c.int) -> c.long ---
|
||||||
@(link_name="fdopendir") _unix_fdopendir :: proc(fd: Handle) -> Dir ---
|
@(link_name="fdopendir") _unix_fdopendir :: proc(fd: Handle) -> Dir ---
|
||||||
@(link_name="closedir") _unix_closedir :: proc(dirp: Dir) -> c.int ---
|
@(link_name="closedir") _unix_closedir :: proc(dirp: Dir) -> c.int ---
|
||||||
@(link_name="rewinddir") _unix_rewinddir :: proc(dirp: Dir) ---
|
@(link_name="rewinddir") _unix_rewinddir :: proc(dirp: Dir) ---
|
||||||
@@ -704,6 +705,11 @@ get_page_size :: proc() -> int {
|
|||||||
return page_size
|
return page_size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_SC_NPROCESSORS_ONLN :: 503
|
||||||
|
get_processor_thread_count :: proc() -> int {
|
||||||
|
thread_count := int(_sysconf(_SC_NPROCESSORS_ONLN))
|
||||||
|
return thread_count
|
||||||
|
}
|
||||||
|
|
||||||
_alloc_command_line_arguments :: proc() -> []string {
|
_alloc_command_line_arguments :: proc() -> []string {
|
||||||
res := make([]string, len(runtime.args__))
|
res := make([]string, len(runtime.args__))
|
||||||
|
|||||||
Reference in New Issue
Block a user