|
253 | 253 | }
|
254 | 254 |
|
255 | 255 | // b_struct__Sched_param.h
|
256 |
| - pub struct _Sched_param { |
| 256 | + pub struct sched_param { |
257 | 257 | pub sched_priority: ::c_int, /* scheduling priority */
|
258 | 258 | pub sched_ss_low_priority: ::c_int, /* low scheduling priority */
|
259 | 259 | pub sched_ss_repl_period: ::_Timespec, /* replenishment period */
|
|
274 | 274 | pub threadAttrSchedpolicy : ::c_int,
|
275 | 275 | pub threadAttrName : *mut ::c_char,
|
276 | 276 | pub threadAttrOptions : ::c_int,
|
277 |
| - pub threadAttrSchedparam : ::_Sched_param, |
| 277 | + pub threadAttrSchedparam : ::sched_param, |
278 | 278 | }
|
279 | 279 |
|
280 | 280 | // signal.h
|
@@ -613,6 +613,12 @@ pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
|
613 | 613 | pub const PTHREAD_STACK_MIN: usize = 4096;
|
614 | 614 | pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30;
|
615 | 615 |
|
| 616 | +pub const SCHED_FIFO: ::c_int = 0x01; |
| 617 | +pub const SCHED_RR: ::c_int = 0x02; |
| 618 | +pub const SCHED_OTHER: ::c_int = 0x04; |
| 619 | +pub const SCHED_SPORADIC: ::c_int = 0x08; |
| 620 | +pub const PRIO_PROCESS: ::c_uint = 0; |
| 621 | + |
616 | 622 | // ERRNO STUFF
|
617 | 623 | pub const ERROR: ::c_int = -1;
|
618 | 624 | pub const OK: ::c_int = 0;
|
@@ -1789,6 +1795,21 @@ extern "C" {
|
1789 | 1795 | __oset: *mut sigset_t,
|
1790 | 1796 | ) -> ::c_int;
|
1791 | 1797 |
|
| 1798 | + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; |
| 1799 | + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; |
| 1800 | + |
| 1801 | + pub fn pthread_setschedparam( |
| 1802 | + native: ::pthread_t, |
| 1803 | + policy: ::c_int, |
| 1804 | + param: *const ::sched_param, |
| 1805 | + ) -> ::c_int; |
| 1806 | + |
| 1807 | + pub fn pthread_getschedparam( |
| 1808 | + native: ::pthread_t, |
| 1809 | + policy: *mut ::c_int, |
| 1810 | + param: *mut ::sched_param, |
| 1811 | + ) -> ::c_int; |
| 1812 | + |
1792 | 1813 | // signal.h for user
|
1793 | 1814 | pub fn kill(__pid: pid_t, __signo: ::c_int) -> ::c_int;
|
1794 | 1815 |
|
|
0 commit comments