-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing syscalls for musl libc #26
Comments
#29 Add |
For python update pub struct Directory {
inner: Mutex<axfs::fops::Directory>,
}
impl Directory {
fn new(inner: axfs::fops::Directory) -> Self {
Self {
inner: Mutex::new(inner),
}
}
fn add_to_fd_table(self) -> LinuxResult<c_int> {
super::fd_ops::add_file_like(Arc::new(self))
}
fn from_fd(fd: c_int) -> LinuxResult<Arc<Self>> {
let f = super::fd_ops::get_file_like(fd)?;
f.into_any()
.downcast::<Self>()
.map_err(|_| LinuxError::EINVAL)
}
}
impl FileLike for Directory {
fn read(&self, buf: &mut [u8]) -> LinuxResult<usize> {
Err(LinuxError::EACCES)
}
fn write(&self, buf: &[u8]) -> LinuxResult<usize> {
Err(LinuxError::EACCES)
}
fn stat(&self) -> LinuxResult<ctypes::stat> {
Err(LinuxError::EACCES)
}
fn into_any(self: Arc<Self>) -> Arc<dyn core::any::Any + Send + Sync> {
self
}
fn poll(&self) -> LinuxResult<PollState> {
Ok(PollState {
readable: true,
writable: true,
})
}
fn set_nonblocking(&self, _nonblocking: bool) -> LinuxResult {
Ok(())
}
} modify /// Open a file under a specific dir
///
///
pub fn sys_openat(_fd: usize, path: *const c_char, flags: c_int, mode: ctypes::mode_t) -> c_int {
let path = char_ptr_to_str(path);
debug!("sys_openat <= {:?}, {:#o} {:#o}", path, flags, mode);
syscall_body!(sys_openat, {
let options = flags_to_options(flags, mode);
if (flags as u32) & ctypes::O_DIRECTORY != 0 {
let dir = axfs::fops::Directory::open_dir(path?, &options)?;
Directory::new(dir).add_to_fd_table()
}
else{
let file = axfs::fops::File::open(path?, &options)?;
File::new(file).add_to_fd_table()
}
})
} add
|
For python add
Then add
|
Missing syscall : |
Missing syscall: |
Maybe |
Missing syscall: |
Missing the implement of syscall |
You can use |
Previous |
A bug in system call below is new version: /// `ppoll` used by A64. Currently ignore signal
pub unsafe fn sys_ppoll(
fds: *mut ctypes::pollfd,
nfds: ctypes::nfds_t,
timeout: *const ctypes::timespec,
_sig_mask: *const ctypes::sigset_t,
_sig_num: ctypes::size_t,
) -> c_int {
let to = if timeout.is_null(){
-1
} else {
Duration::from(*timeout).as_millis() as c_int
};
debug!("sys_ppoll <= nfds: {} timeout: {:?}", nfds, to);
sys_poll(fds, nfds, to)
} |
missing SYS_kill and SYS_times. |
missing SYS_timerfd_create, SYS_timerfd_settime and SYS_timerfd_gettime. |
This issue is intended to collect problems/requirements/demands for syscalls in rukos when integrating apps. Here, you can add:
The text was updated successfully, but these errors were encountered: