bustd 0.1.1

Lightweight process killer daemon for out-of-memory scenarios
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cfg_if::cfg_if;
use libc::{self, c_int};

cfg_if! {
    if #[cfg(target_os = "android")] {
        unsafe fn _errno() -> *mut c_int {
            libc::__errno()
        }
    } else if #[cfg(target_os = "linux")] {
        unsafe fn _errno() -> *mut c_int {
            libc::__errno_location()
        }
    }
}

pub fn errno() -> i32 {
    unsafe { (*_errno()) as i32 }
}