Enable some fs system call test cases

This commit is contained in:
LI Qing
2023-11-28 12:17:42 +08:00
committed by Tate, Hongliang Tian
parent 5bc1312a91
commit ddca4fb2fc
25 changed files with 197 additions and 69 deletions

View File

@ -23,6 +23,10 @@ pub fn sys_write(
let current = current!();
let file_table = current.file_table().lock();
let file = file_table.get_file(fd)?;
if user_buf_len == 0 {
return Ok(SyscallReturn::Return(0));
}
let mut buffer = vec![0u8; user_buf_len];
read_bytes_from_user(user_buf_ptr, &mut buffer)?;
debug!("write content = {:?}", buffer);