Lines Matching refs:fd
526 pub fn close(fd: usize) -> Result<usize, SystemError> { in close()
529 let _file = fd_table_guard.drop_fd(fd as i32)?; in close()
541 pub fn ioctl(fd: usize, cmd: u32, data: usize) -> Result<usize, SystemError> { in ioctl()
546 .get_file_by_fd(fd as i32) in ioctl()
562 pub fn read(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in read()
566 let file = fd_table_guard.get_file_by_fd(fd); in read()
584 pub fn write(fd: i32, buf: &[u8]) -> Result<usize, SystemError> { in write()
589 .get_file_by_fd(fd) in write()
604 pub fn lseek(fd: i32, offset: i64, seek: u32) -> Result<usize, SystemError> { in lseek()
616 .get_file_by_fd(fd) in lseek()
631 pub fn pread(fd: i32, buf: &mut [u8], len: usize, offset: usize) -> Result<usize, SystemError> { in pread()
635 let file = fd_table_guard.get_file_by_fd(fd); in pread()
653 pub fn pwrite(fd: i32, buf: &[u8], len: usize, offset: usize) -> Result<usize, SystemError> { in pwrite()
657 let file = fd_table_guard.get_file_by_fd(fd); in pwrite()
773 pub fn getdents(fd: i32, buf: &mut [u8]) -> Result<usize, SystemError> { in getdents()
777 if fd < 0 || fd as usize > FileDescriptorVec::PROCESS_MAX_FD { in getdents()
785 .get_file_by_fd(fd) in getdents()
1157 pub fn fcntl(fd: i32, cmd: FcntlCommand, arg: i32) -> Result<usize, SystemError> { in fcntl()
1170 return Self::do_dup2(fd, i as i32, &mut fd_table_guard); in fcntl()
1173 fd, in fcntl()
1188 if let Some(file) = fd_table_guard.get_file_by_fd(fd) { in fcntl()
1205 if let Some(file) = fd_table_guard.get_file_by_fd(fd) { in fcntl()
1224 if let Some(file) = fd_table_guard.get_file_by_fd(fd) { in fcntl()
1237 if let Some(file) = fd_table_guard.get_file_by_fd(fd) { in fcntl()
1274 pub fn ftruncate(fd: i32, len: usize) -> Result<usize, SystemError> { in ftruncate()
1278 if let Some(file) = fd_table_guard.get_file_by_fd(fd) { in ftruncate()
1288 fn do_fstat(fd: i32) -> Result<PosixKstat, SystemError> { in do_fstat()
1292 .get_file_by_fd(fd) in do_fstat()
1333 pub fn fstat(fd: i32, usr_kstat: *mut PosixKstat) -> Result<usize, SystemError> { in fstat()
1335 let kstat = Self::do_fstat(fd)?; in fstat()
1342 let fd = Self::open( in stat() localVariable
1348 let r = Self::fstat(fd as i32, user_kstat); in stat()
1349 Self::close(fd).ok(); in stat()
1354 let fd = Self::open( in lstat() localVariable
1360 let r = Self::fstat(fd as i32, user_kstat); in lstat()
1361 Self::close(fd).ok(); in lstat()
1367 let fd = Self::open( in statfs() localVariable
1378 let (_inode_begin, remain_path) = user_path_at(&pcb, fd as i32, &path)?; in statfs()
1385 pub fn fstatfs(fd: i32, user_statfs: *mut PosixStatfs) -> Result<usize, SystemError> { in fstatfs()
1390 .get_file_by_fd(fd) in fstatfs()
1399 fd: i32, in do_statx()
1502 Self::close(fd as usize).ok(); in do_statx()
1534 pub fn writev(fd: i32, iov: usize, count: usize) -> Result<usize, SystemError> { in writev()
1540 Self::write(fd, &data) in writev()
1543 pub fn readv(fd: i32, iov: usize, count: usize) -> Result<usize, SystemError> { in readv()
1549 let len = Self::read(fd, &mut data)?; in readv()
1631 pub fn fchmod(fd: i32, mode: u32) -> Result<usize, SystemError> { in fchmod()
1636 .get_file_by_fd(fd) in fchmod()
1686 pub fn fchown(fd: i32, uid: usize, gid: usize) -> Result<usize, SystemError> { in fchown()
1687 return ksys_fchown(fd, uid, gid); in fchown()