func StartSignalForwarding(handler func(linux.Signal)) func() {
	stop := make(chan struct{})
	done := make(chan struct{})

	// Register individual channels. One channel per standard signal is
	// required as os.Notify() is non-blocking and may drop signals. To avoid
	// this, standard signals have to be queued separately. Channel size 1 is
	// enough for standard signals as their semantics allow de-duplication.
	//
	// External real-time signals are not supported. We rely on the go-runtime
	// for their handling.
	var sigchans []chan os.Signal
	for sig := 1; sig <= numSignals+1; sig++ {
		sigchan := make(chan os.Signal, 1)
		sigchans = append(sigchans, sigchan)
		signal.Notify(sigchan, syscall.Signal(sig))
	}
	// Start up our listener.
	go handleSignals(sigchans, handler, stop, done) // S/R-SAFE: synchronized by Kernel.extMu.

	return func() {
		close(stop)
		<-done
	}
}
// StartSignalForwarding ensures that synchronous signals are passed to the
// given handler function and returns a callback that stops signal delivery.
//
// Note that this function permanently takes over signal handling. After the
// stop callback, signals revert to the default Go runtime behavior, which
// cannot be overridden with external calls to signal.Notify.
StartSignalForwarding ensures that synchronous signals are passed to the
given handler function and returns a callback that stops signal delivery.

Note that this function permanently takes over signal handling. After the
stop callback, signals revert to the default Go runtime behavior, which
cannot be overridden with external calls to signal.Notify.
// StartSignalForwarding ensures that synchronous signals are passed to the // given handler function and returns a callback that stops signal delivery . // // Note that this function permanently takes over signal handling . After the // stop callback signals revert to the default Go runtime behavior which // cannot be overridden with external calls to signal . Notify .
func StartSignalForwarding(handler func(linux.Signal)) func() {
	stop := make(chan struct{})
	done := make(chan struct{})
	 External real-time signals are not supported. We rely on the go-runtime
	 for their handling.
	var sigchans []chan os.Signal
	for sig := 1; sig <= numSignals+1; sig++ {
		sigchan := make(chan os.Signal, 1)
		sigchans = append(sigchans, sigchan)
		signal.Notify(sigchan, syscall.Signal(sig))
	}
	 Start up our listener.
	go handleSignals(sigchans, handler, stop, done)  S/R-SAFE: synchronized by Kernel.extMu.
	return func() {
		close(stop)
		<-done
	}
}
func StartSignalForwarding ( handler func ( linux . Signal ) ) func ( ) { stop := make ( chan struct { } ) done := make ( chan struct { } ) var sigchans [ ] chan os . Signal for sig := 1 ; sig <= numSignals + 1 ; sig ++ { sigchan := make ( chan os . Signal , 1 ) sigchans = append ( sigchans , sigchan ) signal . Notify ( sigchan , syscall . Signal ( sig ) ) } go handleSignals ( sigchans , handler , stop , done ) return func ( ) { close ( stop ) <- done } }
StartSignalForwarding ensures that synchronous signals are passed to the
given handler function and returns a callback that stops signal delivery.
StartSignalForwarding ensures that synchronous signals are passed to the given handler function and returns a callback that stops signal delivery .
// Register individual channels. One channel per standard signal is // required as os.Notify() is non-blocking and may drop signals. To avoid // this, standard signals have to be queued separately. Channel size 1 is // enough for standard signals as their semantics allow de-duplication. // // External real-time signals are not supported. We rely on the go-runtime // for their handling. // Start up our listener. // S/R-SAFE: synchronized by Kernel.extMu.