Source file src/runtime/cgo/sigaction.go
Documentation: runtime/cgo
1 // Copyright 2016 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 (linux && amd64) || (freebsd && amd64) || (linux && arm64) || (linux && ppc64le) 6 // +build linux,amd64 freebsd,amd64 linux,arm64 linux,ppc64le 7 8 package cgo 9 10 // Import "unsafe" because we use go:linkname. 11 import _ "unsafe" 12 13 // When using cgo, call the C library for sigaction, so that we call into 14 // any sanitizer interceptors. This supports using the sanitizers 15 // with Go programs. The thread and memory sanitizers only apply to 16 // C/C++ code; this permits that code to see the Go runtime's existing signal 17 // handlers when registering new signal handlers for the process. 18 19 //go:cgo_import_static x_cgo_sigaction 20 //go:linkname x_cgo_sigaction x_cgo_sigaction 21 //go:linkname _cgo_sigaction _cgo_sigaction 22 var x_cgo_sigaction byte 23 var _cgo_sigaction = &x_cgo_sigaction 24