Silence sys_access and sys_chdir because rust sh use these now

master
Jiajie Chen 6 years ago
parent 285ffc7618
commit 7ee69db575

@ -373,14 +373,20 @@ pub fn sys_access(path: *const u8, mode: usize) -> SysResult {
// TODO: check permissions based on uid/gid
let proc = process();
let path = unsafe { proc.vm.check_and_clone_cstr(path)? };
info!("access: path: {:?}, mode: {:#o}", path, mode);
if !proc.pid.is_init() {
// we trust pid 0 process
info!("access: path: {:?}, mode: {:#o}", path, mode);
}
let inode = proc.lookup_inode(&path)?;
Ok(0)
}
pub fn sys_getcwd(buf: *mut u8, len: usize) -> SysResult {
info!("getcwd: buf: {:?}, len: {:#x}", buf, len);
let proc = process();
if !proc.pid.is_init() {
// we trust pid 0 process
info!("getcwd: buf: {:?}, len: {:#x}", buf, len);
}
proc.vm.check_write_array(buf, len)?;
if proc.cwd.len() + 1 > len {
return Err(SysError::ERANGE);
@ -522,7 +528,10 @@ pub fn sys_dup2(fd1: usize, fd2: usize) -> SysResult {
pub fn sys_chdir(path: *const u8) -> SysResult {
let mut proc = process();
let path = unsafe { proc.vm.check_and_clone_cstr(path)? };
info!("chdir: path: {:?}", path);
if !proc.pid.is_init() {
// we trust pid 0 process
info!("chdir: path: {:?}", path);
}
let inode = proc.lookup_inode(&path)?;
let info = inode.metadata()?;

@ -1 +1 @@
Subproject commit ce51c9b2ecb3195862cb761055e956de0b8f7803
Subproject commit 343574eb12a0595abb1dfc7566408fac993c2ac5
Loading…
Cancel
Save