File tree 11 files changed +50
-0
lines changed
11 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub type fsfilcnt_t = ::c_uint;
19
19
pub type speed_t = :: c_ulong ;
20
20
pub type tcflag_t = :: c_ulong ;
21
21
pub type nl_item = :: c_int ;
22
+ pub type id_t = :: c_uint ;
22
23
23
24
pub enum timezone { }
24
25
@@ -1241,6 +1242,11 @@ pub const CTL_DEBUG_NAME: ::c_int = 0;
1241
1242
pub const CTL_DEBUG_VALUE : :: c_int = 1 ;
1242
1243
pub const CTL_DEBUG_MAXID : :: c_int = 20 ;
1243
1244
1245
+ pub const PRIO_DARWIN_THREAD : :: c_int = 3 ;
1246
+ pub const PRIO_DARWIN_PROCESS : :: c_int = 4 ;
1247
+ pub const PRIO_DARWIN_BG : :: c_int = 0x1000 ;
1248
+ pub const PRIO_DARWIN_NONUI : :: c_int = 0x1001 ;
1249
+
1244
1250
f ! {
1245
1251
pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
1246
1252
status >> 8
@@ -1356,6 +1362,8 @@ extern {
1356
1362
base : :: locale_t ) -> :: locale_t ;
1357
1363
pub fn uselocale ( loc : :: locale_t ) -> :: locale_t ;
1358
1364
pub fn querylocale ( mask : :: c_int , loc : :: locale_t ) -> * const :: c_char ;
1365
+ pub fn getpriority ( which : :: c_int , who : :: id_t ) -> :: c_int ;
1366
+ pub fn setpriority ( which : :: c_int , who : :: id_t , prio : :: c_int ) -> :: c_int ;
1359
1367
}
1360
1368
1361
1369
cfg_if ! {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ pub type pthread_key_t = ::c_int;
10
10
pub type tcflag_t = :: c_uint ;
11
11
pub type speed_t = :: c_uint ;
12
12
pub type nl_item = :: c_int ;
13
+ pub type id_t = i64 ;
13
14
14
15
pub enum timezone { }
15
16
@@ -749,6 +750,8 @@ extern {
749
750
pub fn pthread_attr_getstack ( attr : * const :: pthread_attr_t ,
750
751
stackaddr : * mut * mut :: c_void ,
751
752
stacksize : * mut :: size_t ) -> :: c_int ;
753
+ pub fn getpriority ( which : :: c_int , who : :: c_int ) -> :: c_int ;
754
+ pub fn setpriority ( which : :: c_int , who : :: c_int , prio : :: c_int ) -> :: c_int ;
752
755
}
753
756
754
757
cfg_if ! {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ pub type speed_t = ::c_uint;
10
10
pub type tcflag_t = :: c_uint ;
11
11
pub type nl_item = c_long ;
12
12
pub type clockid_t = :: c_int ;
13
+ pub type id_t = :: uint32_t ;
13
14
14
15
pub enum timezone { }
15
16
@@ -472,6 +473,8 @@ extern {
472
473
name : * mut :: c_char ,
473
474
termp : * mut termios ,
474
475
winp : * mut :: winsize ) -> :: pid_t ;
476
+ pub fn getpriority ( which : :: c_int , who : :: id_t ) -> :: c_int ;
477
+ pub fn setpriority ( which : :: c_int , who : :: id_t , prio : :: c_int ) -> :: c_int ;
475
478
}
476
479
477
480
cfg_if ! {
Original file line number Diff line number Diff line change @@ -181,6 +181,13 @@ pub const LOG_NOWAIT: ::c_int = 0x10;
181
181
pub const LOG_PRIMASK : :: c_int = 7 ;
182
182
pub const LOG_FACMASK : :: c_int = 0x3f8 ;
183
183
184
+ pub const PRIO_PROCESS : :: c_int = 0 ;
185
+ pub const PRIO_PGRP : :: c_int = 1 ;
186
+ pub const PRIO_USER : :: c_int = 2 ;
187
+
188
+ pub const PRIO_MIN : :: c_int = -20 ;
189
+ pub const PRIO_MAX : :: c_int = 20 ;
190
+
184
191
cfg_if ! {
185
192
if #[ cfg( dox) ] {
186
193
// on dox builds don't pull in anything
@@ -773,6 +780,9 @@ extern {
773
780
pub fn closelog ( ) ;
774
781
pub fn setlogmask ( maskpri : :: c_int ) -> :: c_int ;
775
782
pub fn syslog ( priority : :: c_int , message : * const :: c_char , ...) ;
783
+ #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
784
+ link_name = "nice$UNIX2003" ) ]
785
+ pub fn nice ( incr : :: c_int ) -> :: c_int ;
776
786
}
777
787
778
788
cfg_if ! {
Original file line number Diff line number Diff line change @@ -139,6 +139,8 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
139
139
__reserved : [ 0 ; 12 ] ,
140
140
} ;
141
141
pub const PTHREAD_STACK_MIN : :: size_t = 4096 * 2 ;
142
+ pub const CPU_SETSIZE : :: size_t = 32 ;
143
+ pub const __CPU_BITS: :: size_t = 32 ;
142
144
143
145
extern {
144
146
pub fn timegm64 ( tm : * const :: tm ) -> :: time64_t ;
Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
149
149
__reserved : [ 0 ; 36 ] ,
150
150
} ;
151
151
pub const PTHREAD_STACK_MIN : :: size_t = 4096 * 4 ;
152
+ pub const CPU_SETSIZE : :: size_t = 1024 ;
153
+ pub const __CPU_BITS: :: size_t = 64 ;
152
154
153
155
extern {
154
156
pub fn timegm ( tm : * const :: tm ) -> :: time64_t ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ pub type nfds_t = ::c_uint;
21
21
pub type rlim_t = :: c_ulong ;
22
22
pub type dev_t = :: c_ulong ;
23
23
pub type ino_t = :: c_ulong ;
24
+ pub type __CPU_BITTYPE = :: c_ulong ;
24
25
25
26
s ! {
26
27
pub struct dirent {
87
88
pub l_len: :: off_t,
88
89
pub l_pid: :: pid_t,
89
90
}
91
+
92
+ pub struct cpu_set_t {
93
+ #[ cfg( target_pointer_width = "64" ) ]
94
+ __bits: [ __CPU_BITTYPE; 16 ] ,
95
+ #[ cfg( target_pointer_width = "32" ) ]
96
+ __bits: [ __CPU_BITTYPE; 1 ] ,
97
+ }
90
98
}
91
99
92
100
pub const BUFSIZ : :: c_uint = 1024 ;
@@ -546,6 +554,11 @@ extern {
546
554
sevlen : :: size_t ,
547
555
flags : :: c_int ) -> :: c_int ;
548
556
pub fn ptrace ( request : :: c_int , ...) -> :: c_long ;
557
+ pub fn getpriority ( which : :: c_int , who : :: c_int ) -> :: c_int ;
558
+ pub fn setpriority ( which : :: c_int , who : :: c_int , prio : :: c_int ) -> :: c_int ;
559
+ pub fn __sched_cpualloc ( count : :: size_t ) -> * mut :: cpu_set_t ;
560
+ pub fn __sched_cpufree ( set : * mut :: cpu_set_t ) ;
561
+ pub fn __sched_cpucount ( setsize : :: size_t , set : * mut cpu_set_t ) -> :: c_int ;
549
562
}
550
563
551
564
cfg_if ! {
Original file line number Diff line number Diff line change @@ -173,6 +173,8 @@ pub const CLOCK_TAI: ::clockid_t = 11;
173
173
extern {
174
174
pub fn ioctl ( fd : :: c_int , request : :: c_int , ...) -> :: c_int ;
175
175
pub fn ptrace ( request : :: c_int , ...) -> :: c_long ;
176
+ pub fn getpriority ( which : :: c_int , who : :: id_t ) -> :: c_int ;
177
+ pub fn setpriority ( which : :: c_int , who : :: id_t , prio : :: c_int ) -> :: c_int ;
176
178
}
177
179
178
180
cfg_if ! {
Original file line number Diff line number Diff line change 1
1
pub type fsblkcnt_t = :: c_ulong ;
2
2
pub type fsfilcnt_t = :: c_ulong ;
3
3
pub type rlim_t = c_ulong ;
4
+ pub type __priority_which_t = :: c_uint ;
4
5
5
6
s ! {
6
7
pub struct sigaction {
@@ -495,6 +496,9 @@ extern {
495
496
pub fn pthread_attr_setaffinity_np ( attr : * mut :: pthread_attr_t ,
496
497
cpusetsize : :: size_t ,
497
498
cpuset : * const :: cpu_set_t ) -> :: c_int ;
499
+ pub fn getpriority ( which : :: __priority_which_t , who : :: id_t ) -> :: c_int ;
500
+ pub fn setpriority ( which : :: __priority_which_t , who : :: id_t ,
501
+ prio : :: c_int ) -> :: c_int ;
498
502
pub fn pthread_getaffinity_np ( thread : :: pthread_t ,
499
503
cpusetsize : :: size_t ,
500
504
cpuset : * mut :: cpu_set_t ) -> :: c_int ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ pub type speed_t = ::c_uint;
6
6
pub type tcflag_t = :: c_uint ;
7
7
pub type loff_t = :: c_longlong ;
8
8
pub type clockid_t = :: c_int ;
9
+ pub type id_t = :: c_uint ;
9
10
10
11
pub enum timezone { }
11
12
Original file line number Diff line number Diff line change @@ -907,5 +907,7 @@ extern {
907
907
pub fn getprogname ( ) -> * const :: c_char ;
908
908
pub fn setprogname ( name : * const :: c_char ) ;
909
909
pub fn getloadavg ( loadavg : * mut :: c_double , nelem : :: c_int ) -> :: c_int ;
910
+ pub fn getpriority ( which : :: c_int , who : :: c_int ) -> :: c_int ;
911
+ pub fn setpriority ( which : :: c_int , who : :: c_int , prio : :: c_int ) -> :: c_int ;
910
912
}
911
913
You can’t perform that action at this time.
0 commit comments