Remove SYS_PIPE2.

This commit is contained in:
4lDO2
2023-08-31 21:16:26 +02:00
parent da6e9fd8d1
commit ad02f5cbba
4 changed files with 1 additions and 41 deletions
-5
View File
@@ -267,11 +267,6 @@ pub fn format_call(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) -
"virttophys({:#X})",
b
),
SYS_PIPE2 => format!(
"pipe2({:?}, {})",
unsafe { read_struct::<[usize; 2]>(b) },
c
),
SYS_SETREGID => format!(
"setregid({}, {})",
b,
-34
View File
@@ -117,40 +117,6 @@ pub fn open(raw_path: UserSliceRo, flags: usize) -> Result<FileHandle> {
}).ok_or(Error::new(EMFILE))
}
pub fn pipe2(fds: UserSliceWo, flags: usize) -> Result<()> {
let scheme_id = crate::scheme::pipe::pipe_scheme_id();
let (read_id, write_id) = crate::scheme::pipe::pipe(flags)?;
let context_lock = context::current()?;
let context = context_lock.read();
//log::warn!("Context {} used deprecated pipe2.", context.name);
let read_fd = context.add_file(FileDescriptor {
description: Arc::new(RwLock::new(FileDescription {
namespace: context.ens,
scheme: scheme_id,
number: read_id,
flags: O_RDONLY | flags & !O_ACCMODE & !O_CLOEXEC,
})),
cloexec: flags & O_CLOEXEC == O_CLOEXEC,
}).ok_or(Error::new(EMFILE))?;
let write_fd = context.add_file(FileDescriptor {
description: Arc::new(RwLock::new(FileDescription {
namespace: context.ens,
scheme: scheme_id,
number: write_id,
flags: O_WRONLY | flags & !O_ACCMODE & !O_CLOEXEC,
})),
cloexec: flags & O_CLOEXEC == O_CLOEXEC,
}).ok_or(Error::new(EMFILE))?;
let (read_outptr, write_outptr) = fds.split_at(core::mem::size_of::<usize>()).ok_or(Error::new(EINVAL))?;
read_outptr.write_usize(read_fd.into())?;
write_outptr.write_usize(write_fd.into())
}
/// rmdir syscall
pub fn rmdir(raw_path: UserSliceRo) -> Result<usize> {
let (uid, gid, scheme_ns) = match context::current()?.read() {
-1
View File
@@ -162,7 +162,6 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, stack
UserSlice::wo(d, 16)?.none_if_null(),
).map(|()| 0),
SYS_SIGRETURN => sigreturn(),
SYS_PIPE2 => pipe2(UserSlice::wo(b, 2 * core::mem::size_of::<usize>())?, c).map(|()| 0),
SYS_PHYSALLOC => physalloc(b),
SYS_PHYSALLOC3 => physalloc3(b, c, UserSlice::rw(d, core::mem::size_of::<usize>())?),
SYS_PHYSFREE => physfree(b, c),
+1 -1
Submodule syscall updated: a525620c81...745e9eb2bc