Share reboot code between Linux & Android
This commit is contained in:
parent
4624510ae3
commit
ea0a870b4f
|
@ -462,13 +462,6 @@ pub const LOG_NFACILITIES: ::c_int = 24;
|
|||
|
||||
pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
|
||||
|
||||
pub const RB_AUTOBOOT: ::c_int = 0x01234567;
|
||||
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123;
|
||||
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdef;
|
||||
pub const RB_DISABLE_CAD: ::c_int = 0;
|
||||
pub const RB_POWER_OFF: ::c_int = 0x4321fedc;
|
||||
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2;
|
||||
pub const RB_KEXEC: ::c_int = 0x45584543;
|
||||
|
||||
f! {
|
||||
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
|
||||
|
@ -641,7 +634,6 @@ extern {
|
|||
remote_iov: *const ::iovec,
|
||||
riovcnt: ::c_ulong,
|
||||
flags: ::c_ulong) -> isize;
|
||||
pub fn reboot(how_to: ::c_int) -> ::c_int;
|
||||
|
||||
// Not available now on Android
|
||||
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,
|
||||
|
|
|
@ -666,6 +666,14 @@ pub const PIPE_BUF: usize = 4096;
|
|||
|
||||
pub const SI_LOAD_SHIFT: ::c_uint = 16;
|
||||
|
||||
pub const RB_AUTOBOOT: ::c_int = 0x01234567;
|
||||
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123;
|
||||
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdef;
|
||||
pub const RB_DISABLE_CAD: ::c_int = 0;
|
||||
pub const RB_POWER_OFF: ::c_int = 0x4321fedc;
|
||||
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2;
|
||||
pub const RB_KEXEC: ::c_int = 0x45584543;
|
||||
|
||||
f! {
|
||||
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
|
||||
let fd = fd as usize;
|
||||
|
@ -860,6 +868,7 @@ extern {
|
|||
linkpath: *const ::c_char) -> ::c_int;
|
||||
pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char,
|
||||
flags: ::c_int) -> ::c_int;
|
||||
pub fn reboot(how_to: ::c_int) -> ::c_int;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
Loading…
Reference in New Issue