Remove syscalls replaced by the proc manager.
This commit is contained in:
-87
@@ -28,11 +28,6 @@ pub fn dup2(fd: usize, newfd: usize, buf: &[u8]) -> Result<usize> {
|
||||
unsafe { syscall4(SYS_DUP2, fd, newfd, buf.as_ptr() as usize, buf.len()) }
|
||||
}
|
||||
|
||||
/// Exit the current process
|
||||
pub fn exit(status: usize) -> Result<usize> {
|
||||
unsafe { syscall1(SYS_EXIT, status) }
|
||||
}
|
||||
|
||||
/// Change file permissions
|
||||
pub fn fchmod(fd: usize, mode: u16) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_FCHMOD, fd, mode as usize) }
|
||||
@@ -154,51 +149,6 @@ pub unsafe fn futex(
|
||||
)
|
||||
}
|
||||
|
||||
/// Get the effective group ID
|
||||
pub fn getegid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETEGID) }
|
||||
}
|
||||
|
||||
/// Get the effective namespace
|
||||
pub fn getens() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETENS) }
|
||||
}
|
||||
|
||||
/// Get the effective user ID
|
||||
pub fn geteuid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETEUID) }
|
||||
}
|
||||
|
||||
/// Get the current group ID
|
||||
pub fn getgid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETGID) }
|
||||
}
|
||||
|
||||
/// Get the current namespace
|
||||
pub fn getns() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETNS) }
|
||||
}
|
||||
|
||||
/// Get the current process ID
|
||||
pub fn getpid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETPID) }
|
||||
}
|
||||
|
||||
/// Get the process group ID
|
||||
pub fn getpgid(pid: usize) -> Result<usize> {
|
||||
unsafe { syscall1(SYS_GETPGID, pid) }
|
||||
}
|
||||
|
||||
/// Get the parent process ID
|
||||
pub fn getppid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETPPID) }
|
||||
}
|
||||
|
||||
/// Get the current user ID
|
||||
pub fn getuid() -> Result<usize> {
|
||||
unsafe { syscall0(SYS_GETUID) }
|
||||
}
|
||||
|
||||
/// Set the I/O privilege level
|
||||
///
|
||||
/// # Errors
|
||||
@@ -209,11 +159,6 @@ pub unsafe fn iopl(level: usize) -> Result<usize> {
|
||||
syscall1(SYS_IOPL, level)
|
||||
}
|
||||
|
||||
/// Send a signal `sig` to the process identified by `pid`
|
||||
pub fn kill(pid: usize, sig: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_KILL, pid, sig) }
|
||||
}
|
||||
|
||||
/// Create a link to a file
|
||||
pub unsafe fn link(old: *const u8, new: *const u8) -> Result<usize> {
|
||||
syscall2(SYS_LINK, old as usize, new as usize)
|
||||
@@ -289,26 +234,6 @@ pub fn rmdir<T: AsRef<str>>(path: T) -> Result<usize> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the process group ID
|
||||
pub fn setpgid(pid: usize, pgid: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETPGID, pid, pgid) }
|
||||
}
|
||||
|
||||
/// Set the current process group IDs
|
||||
pub fn setregid(rgid: usize, egid: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETREGID, rgid, egid) }
|
||||
}
|
||||
|
||||
/// Make a new scheme namespace
|
||||
pub fn setrens(rns: usize, ens: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETRENS, rns, ens) }
|
||||
}
|
||||
|
||||
/// Set the current process user IDs
|
||||
pub fn setreuid(ruid: usize, euid: usize) -> Result<usize> {
|
||||
unsafe { syscall2(SYS_SETREUID, ruid, euid) }
|
||||
}
|
||||
|
||||
/// Remove a file
|
||||
pub fn unlink<T: AsRef<str>>(path: T) -> Result<usize> {
|
||||
let path = path.as_ref();
|
||||
@@ -330,18 +255,6 @@ pub unsafe fn virttophys(virtual_address: usize) -> Result<usize> {
|
||||
syscall1(SYS_VIRTTOPHYS, virtual_address)
|
||||
}
|
||||
|
||||
/// Check if a child process has exited or received a signal
|
||||
pub fn waitpid(pid: usize, status: &mut usize, options: WaitFlags) -> Result<usize> {
|
||||
unsafe {
|
||||
syscall3(
|
||||
SYS_WAITPID,
|
||||
pid,
|
||||
status as *mut usize as usize,
|
||||
options.bits(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Write a buffer to a file descriptor
|
||||
///
|
||||
/// The kernel will attempt to write the bytes in `buf` to the file descriptor `fd`, returning
|
||||
|
||||
@@ -68,29 +68,11 @@ pub const KSMSG_MMAP_PREP: usize = SYS_CLASS_FILE | 75;
|
||||
pub const KSMSG_CANCEL: usize = SYS_CLASS_FILE | 76;
|
||||
|
||||
pub const SYS_CLOCK_GETTIME: usize = 265;
|
||||
pub const SYS_EXIT: usize = 1;
|
||||
pub const SYS_FUTEX: usize = 240;
|
||||
pub const SYS_GETEGID: usize = 202;
|
||||
pub const SYS_GETENS: usize = 951;
|
||||
pub const SYS_GETEUID: usize = 201;
|
||||
pub const SYS_GETGID: usize = 200;
|
||||
pub const SYS_GETNS: usize = 950;
|
||||
pub const SYS_GETPID: usize = 20;
|
||||
pub const SYS_GETPGID: usize = 132;
|
||||
pub const SYS_GETPPID: usize = 64;
|
||||
pub const SYS_GETUID: usize = 199;
|
||||
pub const SYS_IOPL: usize = 110;
|
||||
pub const SYS_KILL: usize = 37;
|
||||
pub const SYS_SIGQUEUE: usize = 101;
|
||||
pub const SYS_SIGENQUEUE: usize = 101;
|
||||
pub const SYS_SIGDEQUEUE: usize = 102;
|
||||
pub const SYS_MPROTECT: usize = 125;
|
||||
pub const SYS_MKNS: usize = 984;
|
||||
pub const SYS_NANOSLEEP: usize = 162;
|
||||
pub const SYS_VIRTTOPHYS: usize = 949;
|
||||
pub const SYS_SETPGID: usize = 57;
|
||||
pub const SYS_SETREGID: usize = 204;
|
||||
pub const SYS_SETRENS: usize = 952;
|
||||
pub const SYS_SETREUID: usize = 203;
|
||||
pub const SYS_WAITPID: usize = 7;
|
||||
pub const SYS_YIELD: usize = 158;
|
||||
|
||||
Reference in New Issue
Block a user