mirror of
https://github.com/golang/go
synced 2024-11-19 14:34:42 -07:00
runtime: set SIGCONT to _SigNotify + _SigDefault
Use the current ability to say that we don't do anything with SIGCONT by default, but programs can catch it using signal.Notify if they want. Fixes #8953. Change-Id: I67d40ce36a029cbc58a235cbe957335f4a58e1c5 Reviewed-on: https://go-review.googlesource.com/18185 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
ab5d2bf92f
commit
81b35117d9
@ -278,3 +278,12 @@ func TestNohup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test that SIGCONT works (issue 8953).
|
||||
func TestSIGCONT(t *testing.T) {
|
||||
c := make(chan os.Signal, 1)
|
||||
Notify(c, syscall.SIGCONT)
|
||||
defer Stop(c)
|
||||
syscall.Kill(syscall.Getpid(), syscall.SIGCONT)
|
||||
waitSig(t, c, syscall.SIGCONT)
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
|
||||
/* 17 */ {0, "SIGSTOP: stop"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 19 */ {0, "SIGCONT: continue after stop"},
|
||||
/* 19 */ {_SigNotify + _SigDefault, "SIGCONT: continue after stop"},
|
||||
/* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
|
@ -35,7 +35,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 22 */ {_SigNotify, "SIGPOLL: pollable event occured"},
|
||||
/* 23 */ {_SigNotify + _SigDefault, "SIGSTOP: stop (cannot be caught or ignored)"},
|
||||
/* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: user stop requested from tty"},
|
||||
/* 25 */ {0, "SIGCONT: stopped process has been continued"},
|
||||
/* 25 */ {_SigNotify + _SigDefault, "SIGCONT: stopped process has been continued"},
|
||||
/* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background tty read attempted"},
|
||||
/* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background tty write attempted"},
|
||||
/* 28 */ {_SigNotify, "SIGVTALRM: virtual timer expired"},
|
||||
|
@ -32,7 +32,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 15 */ {_SigNotify + _SigKill, "SIGTERM: termination"},
|
||||
/* 16 */ {_SigThrow + _SigUnblock, "SIGSTKFLT: stack fault"},
|
||||
/* 17 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
|
||||
/* 18 */ {0, "SIGCONT: continue"},
|
||||
/* 18 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
|
||||
/* 19 */ {0, "SIGSTOP: stop, unblockable"},
|
||||
/* 20 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
|
@ -38,7 +38,7 @@ var sigtable = [...]sigTabT{
|
||||
/* 22 */ {_SigNotify, "SIGIO: i/o now possible"},
|
||||
/* 23 */ {0, "SIGSTOP: stop, unblockable"},
|
||||
/* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
|
||||
/* 25 */ {0, "SIGCONT: continue"},
|
||||
/* 25 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
|
||||
/* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
|
||||
/* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
|
||||
/* 28 */ {_SigNotify, "SIGVTALRM: virtual alarm clock"},
|
||||
|
Loading…
Reference in New Issue
Block a user