diff --git a/kernel/src/fs/stdio.rs b/kernel/src/fs/stdio.rs index d2ceda2..2595926 100644 --- a/kernel/src/fs/stdio.rs +++ b/kernel/src/fs/stdio.rs @@ -57,7 +57,15 @@ macro_rules! impl_inode { fn move_(&self, _old_name: &str, _target: &Arc, _new_name: &str) -> Result<()> { Err(FsError::NotDir) } fn find(&self, _name: &str) -> Result> { Err(FsError::NotDir) } fn get_entry(&self, _id: usize) -> Result { Err(FsError::NotDir) } - fn io_control(&self, _cmd: u32, _data: u32) -> Result<()> { Err(FsError::NotSupported) } + fn io_control(&self, cmd: u32, data: u32) -> Result<()> { + match cmd { + TIOCGWINSZ => { + // pretend to be tty + Ok(()) + }, + _ => Err(FsError::NotSupported) + } + } fn fs(&self) -> Arc { unimplemented!() } fn as_any_ref(&self) -> &Any { self } }; diff --git a/kernel/src/syscall/mod.rs b/kernel/src/syscall/mod.rs index ef12052..8deeaa2 100644 --- a/kernel/src/syscall/mod.rs +++ b/kernel/src/syscall/mod.rs @@ -194,12 +194,20 @@ pub fn syscall(id: usize, args: [usize; 6], tf: &mut TrapFrame) -> isize { warn!("sys_getegid is unimplemented"); Ok(0) } + SYS_SETPGID => { + warn!("sys_setpgid is unimplemented"); + Ok(0) + } // 110 SYS_GETPPID => sys_getppid(), SYS_SETSID => { warn!("sys_setsid is unimplemented"); Ok(0) } + SYS_GETPGID => { + warn!("sys_getpgid is unimplemented"); + Ok(0) + } SYS_SIGALTSTACK => { warn!("sys_sigaltstack is unimplemented"); Ok(0) @@ -254,9 +262,17 @@ pub fn syscall(id: usize, args: [usize; 6], tf: &mut TrapFrame) -> isize { } SYS_NEWFSTATAT => sys_fstatat(args[0], args[1] as *const u8, args[2] as *mut Stat, args[3]), SYS_UNLINKAT => sys_unlinkat(args[0], args[1] as *const u8, args[2]), - SYS_READLINKAT => sys_readlinkat(args[0], args[1] as *const u8, args[2] as *mut u8, args[3]), + SYS_READLINKAT => { + sys_readlinkat(args[0], args[1] as *const u8, args[2] as *mut u8, args[3]) + } SYS_RENAMEAT => sys_renameat(args[0], args[1] as *const u8, args[2], args[3] as *const u8), - SYS_LINKAT => sys_linkat(args[0], args[1] as *const u8, args[2], args[3] as *const u8, args[4]), + SYS_LINKAT => sys_linkat( + args[0], + args[1] as *const u8, + args[2], + args[3] as *const u8, + args[4], + ), SYS_SYMLINKAT => Err(SysError::EACCES), SYS_FACCESSAT => sys_faccessat(args[0], args[1] as *const u8, args[2], args[3]), // 280 diff --git a/kernel/src/util/mod.rs b/kernel/src/util/mod.rs index ee7eb60..e1ecb67 100644 --- a/kernel/src/util/mod.rs +++ b/kernel/src/util/mod.rs @@ -83,4 +83,4 @@ pub fn write(addr: usize, content: T) { pub fn read(addr: usize) -> T { let cell = (addr) as *const T; unsafe { read_volatile(cell) } -} \ No newline at end of file +}