Force userspace to do post-syscall EINTR check.
This commit is contained in:
+2
-10
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user