mirror of
https://github.com/tiann/KernelSU.git
synced 2025-02-20 11:43:32 +08:00
ksud: make other os build happy
This commit is contained in:
parent
2ebb363350
commit
080aeee5e3
@ -1,3 +1,4 @@
|
||||
#![allow(dead_code, unused_mut, unused_variables)]
|
||||
const KERNEL_SU_OPTION: u32 = 0xDEADBEEF;
|
||||
|
||||
// const CMD_GRANT_ROOT: u64 = 0;
|
||||
@ -12,7 +13,6 @@ const CMD_REPORT_EVENT: u64 = 7;
|
||||
const EVENT_POST_FS_DATA: u64 = 1;
|
||||
const EVENT_BOOT_COMPLETED: u64 = 2;
|
||||
|
||||
|
||||
// pub fn grant_root() -> bool {
|
||||
// let mut result: i32 = 0;
|
||||
// unsafe {
|
||||
@ -29,6 +29,7 @@ const EVENT_BOOT_COMPLETED: u64 = 2;
|
||||
|
||||
pub fn get_version() -> i32 {
|
||||
let mut result: i32 = 0;
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe {
|
||||
libc::prctl(
|
||||
KERNEL_SU_OPTION as i32,
|
||||
@ -36,10 +37,11 @@ pub fn get_version() -> i32 {
|
||||
&mut result as *mut _ as *mut libc::c_void,
|
||||
);
|
||||
}
|
||||
return result;
|
||||
result
|
||||
}
|
||||
|
||||
fn report_event(event: u64){
|
||||
fn report_event(event: u64) {
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe {
|
||||
libc::prctl(
|
||||
KERNEL_SU_OPTION as i32,
|
||||
@ -49,10 +51,10 @@ fn report_event(event: u64){
|
||||
}
|
||||
}
|
||||
|
||||
pub fn report_post_fs_data(){
|
||||
pub fn report_post_fs_data() {
|
||||
report_event(EVENT_POST_FS_DATA);
|
||||
}
|
||||
|
||||
pub fn report_boot_complete(){
|
||||
pub fn report_boot_complete() {
|
||||
report_event(EVENT_BOOT_COMPLETED);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user