From e24451b030856df3727f433d1d9e66806672e0dd Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 17 Sep 2023 23:54:00 +0200 Subject: [PATCH] remove compiler warnings --- src/syscalls/interfaces/mod.rs | 1 + src/syscalls/mod.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/syscalls/interfaces/mod.rs b/src/syscalls/interfaces/mod.rs index 8d4924f977..0c3f2a5978 100644 --- a/src/syscalls/interfaces/mod.rs +++ b/src/syscalls/interfaces/mod.rs @@ -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}; diff --git a/src/syscalls/mod.rs b/src/syscalls/mod.rs index 3aa36413cd..524bcf7716 100644 --- a/src/syscalls/mod.rs +++ b/src/syscalls/mod.rs @@ -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))