github.com/comwrg/go/src@v0.0.0-20220319063731-c238d0440370/runtime/os_freebsd2.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build freebsd && !amd64 6 // +build freebsd,!amd64 7 8 package runtime 9 10 //go:nosplit 11 //go:nowritebarrierrec 12 func setsig(i uint32, fn uintptr) { 13 var sa sigactiont 14 sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART 15 sa.sa_mask = sigset_all 16 if fn == funcPC(sighandler) { 17 fn = funcPC(sigtramp) 18 } 19 sa.sa_handler = fn 20 sigaction(i, &sa, nil) 21 }