Force userspace to do post-syscall EINTR check.

This commit is contained in:
4lDO2
2024-06-27 21:49:19 +02:00
parent e8060b259d
commit f91b90445d
8 changed files with 9 additions and 26 deletions
+2 -10
View File
@@ -67,7 +67,7 @@ pub fn syscall(
e: usize,
f: usize,
stack: &mut InterruptStack,
) {
) -> usize {
#[inline(always)]
fn inner(
a: usize,
@@ -247,13 +247,5 @@ pub fn syscall(
PercpuBlock::current().inside_syscall.set(false);
// errormux turns Result<usize> into -errno
stack.set_syscall_ret_reg(Error::mux(result));
if result == Err(Error::new(EINTR)) {
// Although it would be cleaner to simply run the signal trampoline right after switching
// back to any given context, where the signal set/queue is nonempty, syscalls need to
// complete *before* any signal is delivered. Otherwise the return value would probably be
// overwritten.
crate::context::signal::signal_handler();
}
Error::mux(result)
}