Skip to content

Commit

Permalink
Merge pull request #92 from Lind-Project/disable-signal
Browse files Browse the repository at this point in the history
Comment out signals
  • Loading branch information
rennergade authored Nov 14, 2024
2 parents 09be51a + 52a3fc3 commit 2e71282
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions src/safeposix/syscalls/sys_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,19 @@ impl Cage {
let newsigset = interface::RustHashMap::new();
if !interface::RUSTPOSIX_TESTSUITE.load(interface::RustAtomicOrdering::Relaxed) {
// we don't add these for the test suite
let mainsigsetatomic = self
.sigset
.get(
&self
.main_threadid
.load(interface::RustAtomicOrdering::Relaxed),
)
.unwrap();
let mainsigset = interface::RustAtomicU64::new(
mainsigsetatomic.load(interface::RustAtomicOrdering::Relaxed),
);
newsigset.insert(0, mainsigset);
// BUG: Signals are commented out until we add them to lind-wasm
// let mainsigsetatomic = self
// .sigset
// .get(
// &self
// .main_threadid
// .load(interface::RustAtomicOrdering::Relaxed),
// )
// .unwrap();
// let mainsigset = interface::RustAtomicU64::new(
// mainsigsetatomic.load(interface::RustAtomicOrdering::Relaxed),
// );
// newsigset.insert(0, mainsigset);
}

/*
Expand Down Expand Up @@ -206,18 +207,19 @@ impl Cage {
let newsigset = interface::RustHashMap::new();
if !interface::RUSTPOSIX_TESTSUITE.load(interface::RustAtomicOrdering::Relaxed) {
// we don't add these for the test suite
let mainsigsetatomic = self
.sigset
.get(
&self
.main_threadid
.load(interface::RustAtomicOrdering::Relaxed),
)
.unwrap();
let mainsigset = interface::RustAtomicU64::new(
mainsigsetatomic.load(interface::RustAtomicOrdering::Relaxed),
);
newsigset.insert(0, mainsigset);
// BUG: Signals are commented out until we add them to lind-wasm
// let mainsigsetatomic = self
// .sigset
// .get(
// &self
// .main_threadid
// .load(interface::RustAtomicOrdering::Relaxed),
// )
// .unwrap();
// let mainsigset = interface::RustAtomicU64::new(
// mainsigsetatomic.load(interface::RustAtomicOrdering::Relaxed),
// );
// newsigset.insert(0, mainsigset);
}

let newcage = Cage {
Expand Down Expand Up @@ -259,9 +261,10 @@ impl Cage {
// Trigger SIGCHLD
if !interface::RUSTPOSIX_TESTSUITE.load(interface::RustAtomicOrdering::Relaxed) {
// dont trigger SIGCHLD for test suite
if self.cageid != self.parent {
interface::lind_kill_from_id(self.parent, libc::SIGCHLD);
}
// BUG: Signals are commented out until we add them to lind-wasm
// if self.cageid != self.parent {
// interface::lind_kill_from_id(self.parent, libc::SIGCHLD);
// }
}

//fdtable will be dropped at end of dispatcher scope because of Arc
Expand Down

0 comments on commit 2e71282

Please sign in to comment.