实现uname系统调用 (#614)

* 实现uname系统调用

Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
sspphh
2024-03-19 17:01:20 +08:00
committed by GitHub
parent 82df0a1310
commit 8c6f21840f
4 changed files with 60 additions and 3 deletions

View File

@ -33,7 +33,7 @@ use crate::{
libs::align::page_align_up,
mm::{verify_area, MemoryManagementArch, VirtAddr},
net::syscall::SockAddr,
process::{fork::CloneFlags, Pid},
process::{fork::CloneFlags, syscall::PosixOldUtsName, Pid},
time::{
syscall::{PosixTimeZone, PosixTimeval},
TimeSpec,
@ -949,7 +949,10 @@ impl Syscall {
}
SYS_SCHED_YIELD => Self::sched_yield(),
SYS_UNAME => {
let name = args[0] as *mut PosixOldUtsName;
Self::uname(name)
}
_ => panic!("Unsupported syscall ID: {}", syscall_num),
};

View File

@ -53,6 +53,7 @@
#define SYS_EXIT 60
#define SYS_WAIT4 61
#define SYS_KILL 62
#define SYS_UNAME 63
#define SYS_FCNTL 72