Commit 81b35117 authored by Ian Lance Taylor's avatar Ian Lance Taylor

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/18185Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent ab5d2bf9
...@@ -278,3 +278,12 @@ func TestNohup(t *testing.T) { ...@@ -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{ ...@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{ ...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{ ...@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{ ...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{ ...@@ -29,7 +29,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{ ...@@ -31,7 +31,7 @@ var sigtable = [...]sigTabT{
/* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"}, /* 16 */ {_SigNotify, "SIGURG: urgent condition on socket"},
/* 17 */ {0, "SIGSTOP: stop"}, /* 17 */ {0, "SIGSTOP: stop"},
/* 18 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard 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"}, /* 20 */ {_SigNotify, "SIGCHLD: child status has changed"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 22 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
......
...@@ -35,7 +35,7 @@ var sigtable = [...]sigTabT{ ...@@ -35,7 +35,7 @@ var sigtable = [...]sigTabT{
/* 22 */ {_SigNotify, "SIGPOLL: pollable event occured"}, /* 22 */ {_SigNotify, "SIGPOLL: pollable event occured"},
/* 23 */ {_SigNotify + _SigDefault, "SIGSTOP: stop (cannot be caught or ignored)"}, /* 23 */ {_SigNotify + _SigDefault, "SIGSTOP: stop (cannot be caught or ignored)"},
/* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: user stop requested from tty"}, /* 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"}, /* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background tty read attempted"},
/* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background tty write attempted"}, /* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background tty write attempted"},
/* 28 */ {_SigNotify, "SIGVTALRM: virtual timer expired"}, /* 28 */ {_SigNotify, "SIGVTALRM: virtual timer expired"},
......
...@@ -32,7 +32,7 @@ var sigtable = [...]sigTabT{ ...@@ -32,7 +32,7 @@ var sigtable = [...]sigTabT{
/* 15 */ {_SigNotify + _SigKill, "SIGTERM: termination"}, /* 15 */ {_SigNotify + _SigKill, "SIGTERM: termination"},
/* 16 */ {_SigThrow + _SigUnblock, "SIGSTKFLT: stack fault"}, /* 16 */ {_SigThrow + _SigUnblock, "SIGSTKFLT: stack fault"},
/* 17 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"}, /* 17 */ {_SigNotify + _SigUnblock, "SIGCHLD: child status has changed"},
/* 18 */ {0, "SIGCONT: continue"}, /* 18 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
/* 19 */ {0, "SIGSTOP: stop, unblockable"}, /* 19 */ {0, "SIGSTOP: stop, unblockable"},
/* 20 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"}, /* 20 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
/* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 21 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
......
...@@ -38,7 +38,7 @@ var sigtable = [...]sigTabT{ ...@@ -38,7 +38,7 @@ var sigtable = [...]sigTabT{
/* 22 */ {_SigNotify, "SIGIO: i/o now possible"}, /* 22 */ {_SigNotify, "SIGIO: i/o now possible"},
/* 23 */ {0, "SIGSTOP: stop, unblockable"}, /* 23 */ {0, "SIGSTOP: stop, unblockable"},
/* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"}, /* 24 */ {_SigNotify + _SigDefault, "SIGTSTP: keyboard stop"},
/* 25 */ {0, "SIGCONT: continue"}, /* 25 */ {_SigNotify + _SigDefault, "SIGCONT: continue"},
/* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"}, /* 26 */ {_SigNotify + _SigDefault, "SIGTTIN: background read from tty"},
/* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"}, /* 27 */ {_SigNotify + _SigDefault, "SIGTTOU: background write to tty"},
/* 28 */ {_SigNotify, "SIGVTALRM: virtual alarm clock"}, /* 28 */ {_SigNotify, "SIGVTALRM: virtual alarm clock"},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment