mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
runtime: Define Darwin handled signals list
Fixes: #5990 Some signals may not be defined on non Linux host OSes, like SIGSTKFLT for example. It's also not defined on certain architectures, but irrelevant for this. Signed-off-by: Samuel Ortiz <s.ortiz@apple.com> Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
parent
1b46d4fb50
commit
3b4420eb8e
@ -23,21 +23,6 @@ var signalLog = logrus.WithField("default-signal-logger", true)
|
||||
// or a fatal signal is received.
|
||||
var CrashOnError = false
|
||||
|
||||
// List of handled signals.
|
||||
//
|
||||
// The value is true if receiving the signal should be fatal.
|
||||
var handledSignalsMap = map[syscall.Signal]bool{
|
||||
syscall.SIGABRT: true,
|
||||
syscall.SIGBUS: true,
|
||||
syscall.SIGILL: true,
|
||||
syscall.SIGQUIT: true,
|
||||
syscall.SIGSEGV: true,
|
||||
syscall.SIGSTKFLT: true,
|
||||
syscall.SIGSYS: true,
|
||||
syscall.SIGTRAP: true,
|
||||
syscall.SIGUSR1: false,
|
||||
}
|
||||
|
||||
// DieCb is the callback function type that needs to be defined for every call
|
||||
// into the Die() function. This callback will be run as the first function of
|
||||
// the Die() implementation.
|
||||
|
22
src/runtime/pkg/signals/signals_darwin.go
Normal file
22
src/runtime/pkg/signals/signals_darwin.go
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (c) 2023 Apple Inc.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package signals
|
||||
|
||||
import "syscall"
|
||||
|
||||
// List of handled signals.
|
||||
//
|
||||
// The value is true if receiving the signal should be fatal.
|
||||
var handledSignalsMap = map[syscall.Signal]bool{
|
||||
syscall.SIGABRT: true,
|
||||
syscall.SIGBUS: true,
|
||||
syscall.SIGILL: true,
|
||||
syscall.SIGQUIT: true,
|
||||
syscall.SIGSEGV: true,
|
||||
syscall.SIGSYS: true,
|
||||
syscall.SIGTRAP: true,
|
||||
syscall.SIGUSR1: false,
|
||||
}
|
23
src/runtime/pkg/signals/signals_linux.go
Normal file
23
src/runtime/pkg/signals/signals_linux.go
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright 2018 Intel Corporation.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
package signals
|
||||
|
||||
import "syscall"
|
||||
|
||||
// List of handled signals.
|
||||
//
|
||||
// The value is true if receiving the signal should be fatal.
|
||||
var handledSignalsMap = map[syscall.Signal]bool{
|
||||
syscall.SIGABRT: true,
|
||||
syscall.SIGBUS: true,
|
||||
syscall.SIGILL: true,
|
||||
syscall.SIGQUIT: true,
|
||||
syscall.SIGSEGV: true,
|
||||
syscall.SIGSTKFLT: true,
|
||||
syscall.SIGSYS: true,
|
||||
syscall.SIGTRAP: true,
|
||||
syscall.SIGUSR1: false,
|
||||
}
|
Loading…
Reference in New Issue
Block a user