Home | History | Annotate | Download | only in 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 // +build linux,amd64
      6 
      7 package cgo
      8 
      9 // Import "unsafe" because we use go:linkname.
     10 import _ "unsafe"
     11 
     12 // When using cgo, call the C library for sigaction, so that we call into
     13 // any sanitizer interceptors. This supports using the memory
     14 // sanitizer with Go programs. The memory sanitizer only applies to
     15 // C/C++ code; this permits that code to see the Go runtime's existing signal
     16 // handlers when registering new signal handlers for the process.
     17 
     18 //go:cgo_import_static x_cgo_sigaction
     19 //go:linkname x_cgo_sigaction x_cgo_sigaction
     20 //go:linkname _cgo_sigaction _cgo_sigaction
     21 var x_cgo_sigaction byte
     22 var _cgo_sigaction = &x_cgo_sigaction
     23