mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +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__))
|
||||||
@@ -711,4 +717,4 @@ _alloc_command_line_arguments :: proc() -> []string {
|
|||||||
res[i] = string(arg)
|
res[i] = string(arg)
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user