1*9b0abe6dSLoGin use crate::syscall::SystemError; 2*9b0abe6dSLoGin 3*9b0abe6dSLoGin use super::{fcntl::AtFlags, syscall::ModeType}; 4*9b0abe6dSLoGin 5*9b0abe6dSLoGin pub(super) fn do_faccessat( 6*9b0abe6dSLoGin _dirfd: i32, 7*9b0abe6dSLoGin _pathname: *const u8, 8*9b0abe6dSLoGin mode: ModeType, 9*9b0abe6dSLoGin flags: u32, 10*9b0abe6dSLoGin ) -> Result<usize, SystemError> { 11*9b0abe6dSLoGin if (mode.bits() & (!ModeType::S_IXUGO.bits())) != 0 { 12*9b0abe6dSLoGin return Err(SystemError::EINVAL); 13*9b0abe6dSLoGin } 14*9b0abe6dSLoGin 15*9b0abe6dSLoGin if (flags 16*9b0abe6dSLoGin & (!((AtFlags::AT_EACCESS | AtFlags::AT_SYMLINK_NOFOLLOW | AtFlags::AT_EMPTY_PATH).bits() 17*9b0abe6dSLoGin as u32))) 18*9b0abe6dSLoGin != 0 19*9b0abe6dSLoGin { 20*9b0abe6dSLoGin return Err(SystemError::EINVAL); 21*9b0abe6dSLoGin } 22*9b0abe6dSLoGin 23*9b0abe6dSLoGin // let follow_symlink = flags & AtFlags::AT_SYMLINK_NOFOLLOW.bits() as u32 == 0; 24*9b0abe6dSLoGin 25*9b0abe6dSLoGin // todo: 接着完善(可以借鉴linux 6.1.9的do_faccessat) 26*9b0abe6dSLoGin return Ok(0); 27*9b0abe6dSLoGin } 28