Pretend stdin/stdout as a tty

master
Jiajie Chen 6 years ago
parent b5f194d20f
commit 69449d4eb1

@ -57,7 +57,15 @@ macro_rules! impl_inode {
fn move_(&self, _old_name: &str, _target: &Arc<INode>, _new_name: &str) -> Result<()> { Err(FsError::NotDir) }
fn find(&self, _name: &str) -> Result<Arc<INode>> { Err(FsError::NotDir) }
fn get_entry(&self, _id: usize) -> Result<String> { 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<FileSystem> { unimplemented!() }
fn as_any_ref(&self) -> &Any { self }
};

@ -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

@ -83,4 +83,4 @@ pub fn write<T>(addr: usize, content: T) {
pub fn read<T>(addr: usize) -> T {
let cell = (addr) as *const T;
unsafe { read_volatile(cell) }
}
}

Loading…
Cancel
Save