Skip to content

Commit

Permalink
Share reboot code between Linux & Android
Browse files Browse the repository at this point in the history
  • Loading branch information
bugaevc committed Jul 12, 2016
1 parent 4624510 commit ea0a870
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/unix/notbsd/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> () {
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions src/unix/notbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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! {
Expand Down

0 comments on commit ea0a870

Please sign in to comment.