summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/os_gccgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/os_gccgo.go')
-rw-r--r--libgo/go/runtime/os_gccgo.go25
1 files changed, 2 insertions, 23 deletions
diff --git a/libgo/go/runtime/os_gccgo.go b/libgo/go/runtime/os_gccgo.go
index 1bdef7d43c2..a8f05a4b3d7 100644
--- a/libgo/go/runtime/os_gccgo.go
+++ b/libgo/go/runtime/os_gccgo.go
@@ -21,36 +21,15 @@ func mpreinit(mp *m) {
// minit is called to initialize a new m (including the bootstrap m).
// Called on the new thread, cannot allocate memory.
func minit() {
- // Initialize signal handling.
- _g_ := getg()
-
- var st _stack_t
- sigaltstack(nil, &st)
- if st.ss_flags&_SS_DISABLE != 0 {
- signalstack(_g_.m.gsignalstack, _g_.m.gsignalstacksize)
- _g_.m.newSigstack = true
- } else {
- _g_.m.newSigstack = false
- }
+ minitSignals()
// FIXME: We should set _g_.m.procid here.
-
- // restore signal mask from m.sigmask and unblock essential signals
- nmask := _g_.m.sigmask
- for i := range sigtable {
- if sigtable[i].flags&_SigUnblock != 0 {
- sigdelset(&nmask, int32(i))
- }
- }
- sigprocmask(_SIG_SETMASK, &nmask, nil)
}
// Called from dropm to undo the effect of an minit.
//go:nosplit
func unminit() {
- if getg().m.newSigstack {
- signalstack(nil, 0)
- }
+ unminitSignals()
}
var urandom_dev = []byte("/dev/urandom\x00")