Skip to content

Commit

Permalink
Kill fix (#328)
Browse files Browse the repository at this point in the history
* kill fix

* kill fix
  • Loading branch information
rennergade authored Feb 19, 2025
1 parent 6578cf3 commit ef91183
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/safeposix/syscalls/sys_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,13 @@ impl Cage {
return syscall_error(Errno::EINVAL, "sigkill", "Invalid cage id.");
}


if let Some(cage) = interface::cagetable_getref_opt(cage_id as u64) {
let threadid = cage.main_threadid.load(interface::RustAtomicOrdering::Relaxed);
if threadid == 0 { return syscall_error(Errno::ESRCH, "kill", "Target cage does not exist"); }

interface::lind_threadkill(
cage.main_threadid
.load(interface::RustAtomicOrdering::Relaxed),
threadid,
sig,
);
return 0;
Expand Down

0 comments on commit ef91183

Please sign in to comment.