Skip to content

Commit

Permalink
remove compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Sep 17, 2023
1 parent 62743d4 commit e24451b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/syscalls/interfaces/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use core::ffi::CStr;

pub use self::generic::*;
pub use self::uhyve::*;
use crate::errno::ENOSYS;
use crate::syscalls::fs::{self, FileAttr};
use crate::{arch, env};

Expand Down
12 changes: 12 additions & 0 deletions src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,31 @@ pub extern "C" fn sys_unlink(name: *const u8) -> i32 {
kernel_function!(__sys_unlink(name))
}

#[cfg(target_arch = "x86_64")]
extern "C" fn __sys_mkdir(name: *const u8, mode: u32) -> i32 {
SYS.mkdir(name, mode)
}

#[cfg(not(target_arch = "x86_64"))]
extern "C" fn __sys_mkdir(name: *const u8, mode: u32) -> i32 {
-crate::errno::ENOSYS
}

#[no_mangle]
pub extern "C" fn sys_mkdir(name: *const u8, mode: u32) -> i32 {
kernel_function!(__sys_mkdir(name, mode))
}

#[cfg(target_arch = "x86_64")]
extern "C" fn __sys_rmdir(name: *const u8) -> i32 {
SYS.rmdir(name)
}

#[cfg(not(target_arch = "x86_64"))]
extern "C" fn __sys_rmdir(name: *const u8) -> i32 {
-crate::errno::ENOSYS
}

#[no_mangle]
pub extern "C" fn sys_rmdir(name: *const u8) -> i32 {
kernel_function!(__sys_rmdir(name))
Expand Down

0 comments on commit e24451b

Please sign in to comment.