MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / test_sigaction_uncatchable

Function test_sigaction_uncatchable

tests/system_test/signal_test.cpp:222–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220// ---------------------------------------------------------------------------
221
222void test_sigaction_uncatchable(void* /*arg*/) {
223 klog::Info("=== Signal: Sigaction Uncatchable Test ===");
224 bool passed = true;
225
226 // Attempt to set handler for SIGKILL -- must fail
227 int ret = sys_sigaction(signal_number::kSigKill, kSigIgn);
228 if (ret != -1) {
229 klog::Err(
230 "test_sigaction_uncatchable: sigaction(SIGKILL) returned {} "
231 "(expected -1)",
232 ret);
233 passed = false;
234 }
235
236 // Attempt to set handler for SIGSTOP -- must fail
237 ret = sys_sigaction(signal_number::kSigStop, kSigIgn);
238 if (ret != -1) {
239 klog::Err(
240 "test_sigaction_uncatchable: sigaction(SIGSTOP) returned {} "
241 "(expected -1)",
242 ret);
243 passed = false;
244 }
245
246 if (!passed) {
247 g_tests_failed++;
248 }
249 g_tests_completed++;
250 klog::Info("Signal Sigaction Uncatchable Test: {}",
251 passed ? "PASSED" : "FAILED");
252 sys_exit(passed ? 0 : 1);
253}
254
255// ---------------------------------------------------------------------------
256// test_sigprocmask

Callers

nothing calls this directly

Calls 4

InfoFunction · 0.85
sys_sigactionFunction · 0.85
ErrFunction · 0.85
sys_exitFunction · 0.85

Tested by

no test coverage detected