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,19 @@ 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
+ //sched.h
617
+ pub const SCHED_FIFO : :: c_int = 0x01 ;
618
+ pub const SCHED_RR : :: c_int = 0x02 ;
619
+ pub const SCHED_OTHER : :: c_int = 0x04 ;
620
+ pub const SCHED_SPORADIC : :: c_int = 0x08 ;
621
+ pub const PRIO_PROCESS : :: c_uint = 0 ;
622
+ pub const SCHED_FIFO_HIGH_PRI : :: c_int = 255 ;
623
+ pub const SCHED_FIFO_LOW_PRI : :: c_int = 0 ;
624
+ pub const SCHED_RR_HIGH_PRI : :: c_int = 255 ;
625
+ pub const SCHED_RR_LOW_PRI : :: c_int = 0 ;
626
+ pub const SCHED_SPORADIC_HIGH_PRI : :: c_int = 255 ;
627
+ pub const SCHED_SPORADIC_LOW_PRI : :: c_int = 0 ;
628
+
616
629
// ERRNO STUFF
617
630
pub const ERROR : :: c_int = -1 ;
618
631
pub const OK : :: c_int = 0 ;
@@ -1388,6 +1401,29 @@ extern "C" {
1388
1401
value : * mut :: c_void ,
1389
1402
) -> :: c_int ;
1390
1403
1404
+ //pthread.h
1405
+ pub fn pthread_setschedparam (
1406
+ native : :: pthread_t ,
1407
+ policy : :: c_int ,
1408
+ param : * const :: sched_param ,
1409
+ ) -> :: c_int ;
1410
+
1411
+ //pthread.h
1412
+ pub fn pthread_getschedparam (
1413
+ native : :: pthread_t ,
1414
+ policy : * mut :: c_int ,
1415
+ param : * mut :: sched_param ,
1416
+ ) -> :: c_int ;
1417
+
1418
+ //pthread.h
1419
+ pub fn pthread_attr_setinheritsched (
1420
+ attr : * mut :: pthread_attr_t ,
1421
+ inheritsched : :: c_int ,
1422
+ ) -> :: c_int ;
1423
+
1424
+ //pthread.h
1425
+ pub fn pthread_attr_setschedpolicy ( attr : * mut :: pthread_attr_t , policy : :: c_int ) -> :: c_int ;
1426
+
1391
1427
// pthread.h
1392
1428
pub fn pthread_attr_destroy ( thread : * mut :: pthread_attr_t ) -> :: c_int ;
1393
1429
@@ -1400,6 +1436,7 @@ extern "C" {
1400
1436
parent : :: Option < unsafe extern "C" fn ( ) > ,
1401
1437
child : :: Option < unsafe extern "C" fn ( ) > ,
1402
1438
) -> :: c_int ;
1439
+
1403
1440
// stat.h
1404
1441
pub fn fstat ( fildes : :: c_int , buf : * mut stat ) -> :: c_int ;
1405
1442
@@ -1754,6 +1791,31 @@ extern "C" {
1754
1791
// dirent.h
1755
1792
pub fn closedir ( ptr : * mut :: DIR ) -> :: c_int ;
1756
1793
1794
+ //sched.h
1795
+ pub fn sched_get_priority_max ( policy : :: c_int ) -> :: c_int ;
1796
+
1797
+ //sched.h
1798
+ pub fn sched_get_priority_min ( policy : :: c_int ) -> :: c_int ;
1799
+
1800
+ //sched.h
1801
+ pub fn sched_setparam ( pid : :: pid_t , param : * const :: sched_param ) -> :: c_int ;
1802
+
1803
+ //sched.h
1804
+ pub fn sched_getparam ( pid : :: pid_t , param : * mut :: sched_param ) -> :: c_int ;
1805
+
1806
+ //sched.h
1807
+ pub fn sched_setscheduler (
1808
+ pid : :: pid_t ,
1809
+ policy : :: c_int ,
1810
+ param : * const :: sched_param ,
1811
+ ) -> :: c_int ;
1812
+
1813
+ //sched.h
1814
+ pub fn sched_getscheduler ( pid : :: pid_t ) -> :: c_int ;
1815
+
1816
+ //sched.h
1817
+ pub fn sched_rr_get_interval ( pid : :: pid_t , tp : * mut :: timespec ) -> :: c_int ;
1818
+
1757
1819
// sched.h
1758
1820
pub fn sched_yield ( ) -> :: c_int ;
1759
1821
0 commit comments