summaryrefslogtreecommitdiffstats
path: root/third_party/rust/mach2/src/mach_init.rs
blob: 5776988cb519f001b3f9a9dab259b287827b5b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! This module corresponds to `mach/mach_init.h`.

use mach_types::thread_port_t;

extern "C" {
    pub fn mach_thread_self() -> thread_port_t;
}

#[cfg(test)]
mod tests {
    use mach_init::*;
    use port::*;

    #[test]
    fn mach_thread_self_test() {
        unsafe {
            let this_thread = mach_thread_self();
            assert!(this_thread != MACH_PORT_NULL);
            assert!(this_thread != MACH_PORT_DEAD);
        }
    }
}