|
51 | 51 | pub sun_family: ::sa_family_t, |
52 | 52 | pub sun_path: [::c_char; 104usize], |
53 | 53 | } |
| 54 | + |
| 55 | + pub struct sched_param { |
| 56 | + pub sched_priority: ::c_int, |
| 57 | + } |
54 | 58 | } |
55 | 59 |
|
56 | 60 | pub const SIGEV_NONE: ::c_int = 1; |
@@ -151,6 +155,10 @@ pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; |
151 | 155 | pub const GRND_NONBLOCK: ::c_uint = 0x1; |
152 | 156 | pub const GRND_RANDOM: ::c_uint = 0x2; |
153 | 157 |
|
| 158 | +// For pthread get/setschedparam |
| 159 | +pub const SCHED_FIFO: ::c_int = 1; |
| 160 | +pub const SCHED_RR: ::c_int = 2; |
| 161 | + |
154 | 162 | // Horizon OS works doesn't or can't hold any of this information |
155 | 163 | safe_f! { |
156 | 164 | pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool { |
@@ -194,11 +202,39 @@ extern "C" { |
194 | 202 | value: *mut ::c_void, |
195 | 203 | ) -> ::c_int; |
196 | 204 |
|
197 | | - pub fn pthread_attr_setpriority(attr: *mut ::pthread_attr_t, priority: ::c_int) -> ::c_int; |
| 205 | + pub fn pthread_attr_getschedparam( |
| 206 | + attr: *const ::pthread_attr_t, |
| 207 | + param: *mut sched_param, |
| 208 | + ) -> ::c_int; |
| 209 | + |
| 210 | + pub fn pthread_attr_setschedparam( |
| 211 | + attr: *mut ::pthread_attr_t, |
| 212 | + param: *const sched_param, |
| 213 | + ) -> ::c_int; |
| 214 | + |
| 215 | + pub fn pthread_attr_getidealprocessor_np( |
| 216 | + attr: *const ::pthread_attr_t, |
| 217 | + ideal_processor: *mut ::c_int, |
| 218 | + ) -> ::c_int; |
198 | 219 |
|
199 | | - pub fn pthread_attr_setaffinity(attr: *mut ::pthread_attr_t, affinity: ::c_int) -> ::c_int; |
| 220 | + pub fn pthread_attr_setidealprocessor_np( |
| 221 | + attr: *mut ::pthread_attr_t, |
| 222 | + ideal_processor: ::c_int, |
| 223 | + ) -> ::c_int; |
200 | 224 |
|
201 | | - pub fn pthread_getpriority() -> ::c_int; |
| 225 | + pub fn pthread_getschedparam( |
| 226 | + native: ::pthread_t, |
| 227 | + policy: *mut ::c_int, |
| 228 | + param: *mut ::sched_param, |
| 229 | + ) -> ::c_int; |
| 230 | + |
| 231 | + pub fn pthread_setschedparam( |
| 232 | + native: ::pthread_t, |
| 233 | + policy: ::c_int, |
| 234 | + param: *const ::sched_param, |
| 235 | + ) -> ::c_int; |
| 236 | + |
| 237 | + pub fn pthread_getprocessorid_np() -> ::c_int; |
202 | 238 |
|
203 | 239 | pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; |
204 | 240 |
|
|
0 commit comments