Add and fix test for kill&waitpid.

This commit is contained in:
4lDO2
2025-04-16 23:44:36 +02:00
parent 0083043736
commit 37b60b67e0
3 changed files with 12 additions and 14 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
#define _BITS_SYS_WAIT_H
#define WEXITSTATUS(s) (((s) >> 8) & 0xff)
#define WTERMSIG(s) (((s) & 0x7f) != 0)
#define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WCOREDUMP(s) (((s) & 0x80) != 0)
#define WIFEXITED(s) (((s) & 0x7f) == 0)
+10 -13
View File
@@ -6,16 +6,10 @@ use syscall::{
};
use crate::{
arch::*,
proc::FdGuard,
protocol::{
arch::*, current_proc_fd, proc::FdGuard, protocol::{
ProcCall, RtSigInfo, ThreadCall, SIGCHLD, SIGKILL, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU,
SIGURG, SIGWINCH,
},
static_proc_info,
sync::Mutex,
sys::{proc_call, this_thread_call},
RtTcb, Tcb,
}, static_proc_info, sync::Mutex, sys::{proc_call, this_thread_call}, RtTcb, Tcb
};
#[cfg(target_arch = "x86_64")]
@@ -162,9 +156,13 @@ unsafe fn inner(stack: &mut SigStack) {
panic!("ctl {:x?} signal {}", os.control, stack.sig_num)
}
SigactionKind::Default => {
//syscall::exit(stack.sig_num as usize);
todo!("exit");
unreachable!();
let sig = (stack.sig_num & 0x3f) as u8;
let _ = proc_call(**current_proc_fd(), &mut [], CallFlags::empty(), &[
ProcCall::Exit as u64,
u64::from(sig) << 8,
]);
core::intrinsics::abort()
}
SigactionKind::Handled { handler } => handler,
};
@@ -508,8 +506,7 @@ bitflags::bitflags! {
const STORED_FLAGS: u32 = 0xfe00_0000;
fn default_handler(sig: c_int) {
//syscall::exit(sig as usize);
todo!("exit")
unreachable!();
}
#[derive(Clone, Copy)]
+1
View File
@@ -127,6 +127,7 @@ EXPECT_NAMES=\
unistd/rmdir \
waitpid \
waitpid_multiple \
kill-waitpid \
# unistd/sleep \
unistd/swab \
unistd/write \