Skip to content

Commit d619103

Browse files
committed
apple handful of pthread api update.
1 parent 7cc1cf3 commit d619103

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ impl ::Clone for timezone {
6868
}
6969
}
7070

71+
#[cfg_attr(feature = "extra_traits", derive(Debug))]
72+
#[repr(u32)]
73+
pub enum qos_class_t {
74+
QOS_CLASS_USER_INTERACTIVE = 0x21,
75+
QOS_CLASS_USER_INITIATED = 0x19,
76+
QOS_CLASS_DEFAULT = 0x15,
77+
QOS_CLASS_UTILITY = 0x11,
78+
QOS_CLASS_BACKGROUND = 0x09,
79+
QOS_CLASS_UNSPECIFIED = 0x00,
80+
}
81+
impl ::Copy for qos_class_t {}
82+
impl ::Clone for qos_class_t {
83+
fn clone(&self) -> qos_class_t {
84+
*self
85+
}
86+
}
87+
7188
s! {
7289
pub struct ip_mreq {
7390
pub imr_multiaddr: in_addr,
@@ -3568,6 +3585,23 @@ extern "C" {
35683585
val: *mut ::c_int,
35693586
) -> ::c_int;
35703587
pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
3588+
pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int;
3589+
pub fn pthread_attr_set_qos_class_np(
3590+
attr: *mut pthread_attr_t,
3591+
class: qos_class_t,
3592+
priority: ::c_int,
3593+
) -> ::c_int;
3594+
pub fn pthread_attr_get_qos_class_np(
3595+
attr: *mut pthread_attr_t,
3596+
class: *mut qos_class_t,
3597+
priority: *mut ::c_int,
3598+
) -> ::c_int;
3599+
pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int;
3600+
pub fn pthread_get_qos_class_np(
3601+
thread: ::pthread_t,
3602+
class: *mut qos_class_t,
3603+
priority: *mut ::c_int,
3604+
) -> ::c_int;
35713605
pub fn __error() -> *mut ::c_int;
35723606
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
35733607
#[cfg_attr(

0 commit comments

Comments
 (0)