Skip to content

Commit 883d356

Browse files
committed
Add some constants for learning about cpus
1 parent 6736e10 commit 883d356

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/unix/bsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ pub const ST_RDONLY: ::c_ulong = 1;
9898

9999
pub const NI_MAXHOST: ::socklen_t = 1025;
100100

101+
pub const CTL_HW: ::c_int = 6;
102+
pub const HW_AVAILCPU: ::c_int = 25;
103+
pub const HW_NCPU: ::c_int = 3;
104+
101105
f! {
102106
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
103107
let fd = fd as usize;

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 82;
163163
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 83;
164164
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84;
165165
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85;
166+
pub const _SC_NPROCESSORS_ONLN: ::c_int = 97;
166167

167168
pub const PTHREAD_STACK_MIN: ::size_t = 8192;
168169
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {

0 commit comments

Comments
 (0)