Lines Matching refs:usize
129 pub fn open(path: &str, mode: FileMode) -> Result<usize, SystemError> { in open() argument
132 if path.len() > PAGE_4K_SIZE as usize { in open()
184 let r = current_pcb().alloc_fd(file, None).map(|fd| fd as usize); in open()
194 pub fn close(fd: usize) -> Result<usize, SystemError> { in close() argument
206 pub fn read(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in read() argument
224 pub fn write(fd: i32, buf: &[u8]) -> Result<usize, SystemError> { in write() argument
242 pub fn lseek(fd: i32, seek: SeekFrom) -> Result<usize, SystemError> { in lseek() argument
274 pub fn chdir(dest_path: &str) -> Result<usize, SystemError> { in chdir() argument
308 pub fn getdents(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in getdents() argument
325 return file.readdir(dirent).map(|x| x as usize); in getdents()
333 pub fn mkdir(path: &str, mode: usize) -> Result<usize, SystemError> { in mkdir() argument
334 return do_mkdir(path, FileMode::from_bits_truncate(mode as u32)).map(|x| x as usize); in mkdir()
346 pub fn unlinkat(_dirfd: i32, pathname: &str, flags: u32) -> Result<usize, SystemError> { in unlinkat() argument
377 pub fn dup(oldfd: i32) -> Result<usize, SystemError> { in dup() argument
382 if let Some(file) = &fds.fds[oldfd as usize] { in dup()
387 let res = current_pcb().alloc_fd(*file_cp, None).map(|x| x as usize); in dup()
412 pub fn dup2(oldfd: i32, newfd: i32) -> Result<usize, SystemError> { in dup2() argument
419 return Ok(newfd as usize); in dup2()
422 if let Some(file) = &fds.fds[oldfd as usize] { in dup2()
423 if fds.fds[newfd as usize].is_some() { in dup2()
439 .map(|x| x as usize); in dup2()
459 pub fn fcntl(fd: i32, cmd: FcntlCommand, arg: i32) -> Result<usize, SystemError> { in fcntl() argument
462 if arg < 0 || arg as usize >= FileDescriptorVec::PROCESS_MAX_FD { in fcntl()
465 let arg = arg as usize; in fcntl()
468 if fds.fds[i as usize].is_none() { in fcntl()
480 if let Some(file) = &fds.fds[fd as usize] { in fcntl()
482 return Ok(FD_CLOEXEC as usize); in fcntl()
494 if let Some(file) = &mut fds.fds[fd as usize] { in fcntl()
513 if let Some(file) = &fds.fds[fd as usize] { in fcntl()
514 return Ok(file.mode().bits() as usize); in fcntl()
525 if let Some(file) = &mut fds.fds[fd as usize] { in fcntl()
562 pub fn ftruncate(fd: i32, len: usize) -> Result<usize, SystemError> { in ftruncate() argument
565 if let Some(file) = &mut fds.fds[fd as usize] { in ftruncate()
620 pub fn fstat(fd: i32, usr_kstat: *mut PosixKstat) -> Result<usize, SystemError> { in fstat() argument
642 pub iov_len: usize,
662 iovcnt: usize, in from_user() argument
667 iov as usize as u64, in from_user()
684 if !verify_area(iov.iov_base as usize as u64, iov.iov_len as u64) { in from_user()
727 let total_len: usize = self.0.iter().map(|slice| slice.len()).sum(); in new_buf()