Skip to content

Commit

Permalink
Merge pull request kata-containers#5991 from dcantah/darwin-sigs
Browse files Browse the repository at this point in the history
runtime: Define Darwin handled signals list
  • Loading branch information
liubin authored Jan 7, 2023
2 parents bc8a642 3b4420e commit 2c10b37
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/runtime/pkg/signals/signals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions src/runtime/pkg/signals/signals_darwin.go
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions src/runtime/pkg/signals/signals_linux.go
Original file line number Diff line number Diff line change
@@ -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,
}

0 comments on commit 2c10b37

Please sign in to comment.