实现SystemV共享内存 (#690)

* 实现SystemV共享内存

* 测试shm

* 添加测试程序

* 完善细节

* 修正shm的时间数据错误的问题

* fix: devfs的metadata权限为0x777的错误

---------

Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
Jomo
2024-04-07 14:04:19 +08:00
committed by GitHub
parent eb49bb993a
commit 6fc066ac11
49 changed files with 1567 additions and 202 deletions

View File

@ -26,7 +26,7 @@ use crate::{
sched::{schedule, SchedMode},
time::{
timer::{next_n_us_timer_jiffies, Timer, WakeUpHelper},
TimeSpec,
PosixTimeSpec,
},
};
@ -394,7 +394,7 @@ impl EventPoll {
epfd: i32,
epoll_event: &mut [EPollEvent],
max_events: i32,
timespec: Option<TimeSpec>,
timespec: Option<PosixTimeSpec>,
) -> Result<usize, SystemError> {
let current_pcb = ProcessManager::current_pcb();
let fd_table = current_pcb.fd_table();

View File

@ -9,7 +9,7 @@ use crate::{
user_access::{UserBufferReader, UserBufferWriter},
Syscall,
},
time::TimeSpec,
time::PosixTimeSpec,
};
use super::{EPollCtlOption, EPollEvent, EventPoll};
@ -42,14 +42,14 @@ impl Syscall {
let mut timespec = None;
if timeout == 0 {
timespec = Some(TimeSpec::new(0, 0));
timespec = Some(PosixTimeSpec::new(0, 0));
}
if timeout > 0 {
let sec: i64 = timeout as i64 / 1000;
let nsec: i64 = 1000000 * (timeout as i64 % 1000);
timespec = Some(TimeSpec::new(sec, nsec))
timespec = Some(PosixTimeSpec::new(sec, nsec))
}
// 从用户传入的地址中拿到epoll_events