|
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;
|
@@ -147,6 +151,10 @@ pub const FIONBIO: ::c_ulong = 1;
|
147 | 151 |
|
148 | 152 | pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;
|
149 | 153 |
|
| 154 | +// For pthread get/setschedparam |
| 155 | +pub const SCHED_FIFO: ::c_int = 1; |
| 156 | +pub const SCHED_RR: ::c_int = 2; |
| 157 | + |
150 | 158 | // Horizon OS works doesn't or can't hold any of this information
|
151 | 159 | safe_f! {
|
152 | 160 | pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool {
|
@@ -190,5 +198,39 @@ extern "C" {
|
190 | 198 | value: *mut ::c_void,
|
191 | 199 | ) -> ::c_int;
|
192 | 200 |
|
| 201 | + pub fn pthread_attr_getschedparam( |
| 202 | + attr: *const ::pthread_attr_t, |
| 203 | + param: *mut sched_param, |
| 204 | + ) -> ::c_int; |
| 205 | + |
| 206 | + pub fn pthread_attr_setschedparam( |
| 207 | + attr: *mut ::pthread_attr_t, |
| 208 | + param: *const sched_param, |
| 209 | + ) -> ::c_int; |
| 210 | + |
| 211 | + pub fn pthread_attr_getprocessorid_np( |
| 212 | + attr: *const ::pthread_attr_t, |
| 213 | + processor_id: *mut ::c_int, |
| 214 | + ) -> ::c_int; |
| 215 | + |
| 216 | + pub fn pthread_attr_setprocessorid_np( |
| 217 | + attr: *mut ::pthread_attr_t, |
| 218 | + processor_id: ::c_int, |
| 219 | + ) -> ::c_int; |
| 220 | + |
| 221 | + pub fn pthread_getschedparam( |
| 222 | + native: ::pthread_t, |
| 223 | + policy: *mut ::c_int, |
| 224 | + param: *mut ::sched_param, |
| 225 | + ) -> ::c_int; |
| 226 | + |
| 227 | + pub fn pthread_setschedparam( |
| 228 | + native: ::pthread_t, |
| 229 | + policy: ::c_int, |
| 230 | + param: *const ::sched_param, |
| 231 | + ) -> ::c_int; |
| 232 | + |
| 233 | + pub fn pthread_getprocessorid_np() -> ::c_int; |
| 234 | + |
193 | 235 | pub fn gethostid() -> ::c_long;
|
194 | 236 | }
|
0 commit comments