MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / check_error

Method check_error

os/src/task/signal.rs:14–28  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

12
13impl SignalFlags {
14 pub fn check_error(&self) -> Option<(i32, &'static str)> {
15 if self.contains(Self::SIGINT) {
16 Some((-2, "Killed, SIGINT=2"))
17 } else if self.contains(Self::SIGILL) {
18 Some((-4, "Illegal Instruction, SIGILL=4"))
19 } else if self.contains(Self::SIGABRT) {
20 Some((-6, "Aborted, SIGABRT=6"))
21 } else if self.contains(Self::SIGFPE) {
22 Some((-8, "Erroneous Arithmetic Operation, SIGFPE=8"))
23 } else if self.contains(Self::SIGSEGV) {
24 Some((-11, "Segmentation Fault, SIGSEGV=11"))
25 } else {
26 None
27 }
28 }
29}

Callers 1

check_signals_of_currentFunction · 0.80

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected