mirror of
https://github.com/golang/go
synced 2024-10-01 13:28:37 -06:00
runtime: provide a dummy value of _SIGPROF on plan9 and windows
Fixes build on plan9 and windows. Change-Id: Ic9b02c641ab84e4f6d8149de71b9eb495e3343b2 Reviewed-on: https://go-review.googlesource.com/2233 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
parent
0b2a74e89c
commit
1f28238557
@ -41,6 +41,7 @@ const (
|
|||||||
DUPLICATE_SAME_ACCESS = C.DUPLICATE_SAME_ACCESS
|
DUPLICATE_SAME_ACCESS = C.DUPLICATE_SAME_ACCESS
|
||||||
THREAD_PRIORITY_HIGHEST = C.THREAD_PRIORITY_HIGHEST
|
THREAD_PRIORITY_HIGHEST = C.THREAD_PRIORITY_HIGHEST
|
||||||
|
|
||||||
|
SIGPROF = 0 // dummy value for badsignal
|
||||||
SIGINT = C.SIGINT
|
SIGINT = C.SIGINT
|
||||||
CTRL_C_EVENT = C.CTRL_C_EVENT
|
CTRL_C_EVENT = C.CTRL_C_EVENT
|
||||||
CTRL_BREAK_EVENT = C.CTRL_BREAK_EVENT
|
CTRL_BREAK_EVENT = C.CTRL_BREAK_EVENT
|
||||||
|
@ -15,6 +15,7 @@ const (
|
|||||||
_DUPLICATE_SAME_ACCESS = 0x2
|
_DUPLICATE_SAME_ACCESS = 0x2
|
||||||
_THREAD_PRIORITY_HIGHEST = 0x2
|
_THREAD_PRIORITY_HIGHEST = 0x2
|
||||||
|
|
||||||
|
_SIGPROF = 0 // dummy value for badsignal
|
||||||
_SIGINT = 0x2
|
_SIGINT = 0x2
|
||||||
_CTRL_C_EVENT = 0x0
|
_CTRL_C_EVENT = 0x0
|
||||||
_CTRL_BREAK_EVENT = 0x1
|
_CTRL_BREAK_EVENT = 0x1
|
||||||
|
@ -15,6 +15,7 @@ const (
|
|||||||
_DUPLICATE_SAME_ACCESS = 0x2
|
_DUPLICATE_SAME_ACCESS = 0x2
|
||||||
_THREAD_PRIORITY_HIGHEST = 0x2
|
_THREAD_PRIORITY_HIGHEST = 0x2
|
||||||
|
|
||||||
|
_SIGPROF = 0 // dummy value for badsignal
|
||||||
_SIGINT = 0x2
|
_SIGINT = 0x2
|
||||||
_CTRL_C_EVENT = 0x0
|
_CTRL_C_EVENT = 0x0
|
||||||
_CTRL_BREAK_EVENT = 0x1
|
_CTRL_BREAK_EVENT = 0x1
|
||||||
|
@ -69,4 +69,6 @@ const (
|
|||||||
_SIGINTDIV = 4
|
_SIGINTDIV = 4
|
||||||
_SIGFLOAT = 5
|
_SIGFLOAT = 5
|
||||||
_SIGTRAP = 6
|
_SIGTRAP = 6
|
||||||
|
// dummy value defined for badsignal
|
||||||
|
_SIGPROF = 0
|
||||||
)
|
)
|
||||||
|
@ -160,8 +160,13 @@ func badsignal(sig uintptr) {
|
|||||||
// call to cgocallback below will bring down the whole process.
|
// call to cgocallback below will bring down the whole process.
|
||||||
// It's better to miss a few SIGPROF signals than to abort in this case.
|
// It's better to miss a few SIGPROF signals than to abort in this case.
|
||||||
// See http://golang.org/issue/9456.
|
// See http://golang.org/issue/9456.
|
||||||
|
switch GOOS {
|
||||||
|
case "windows", "plan9":
|
||||||
|
// no actual SIGPROF is defined, nothing to do
|
||||||
|
default:
|
||||||
if sig == _SIGPROF && needextram != 0 {
|
if sig == _SIGPROF && needextram != 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
cgocallback(unsafe.Pointer(funcPC(sigsend)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
|
cgocallback(unsafe.Pointer(funcPC(sigsend)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user