1
0
mirror of https://github.com/golang/go synced 2024-10-02 04:18:33 -06: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:
Ian Lance Taylor 2015-12-31 12:06:31 -08:00
parent ab5d2bf92f
commit 81b35117d9
10 changed files with 18 additions and 9 deletions

View File

@ -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)
}

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},

View File

@ -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"},