mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
Implement all of os.Signal in arch-specific syscall
This is basically copied from `syscall_js.go` from the Go standard library, since the existing parts were from there as well.
This commit is contained in:
committed by
Ron Evans
parent
e49e93f22c
commit
bc098da93f
@@ -3,6 +3,10 @@
|
||||
|
||||
package syscall
|
||||
|
||||
import (
|
||||
"internal/itoa"
|
||||
)
|
||||
|
||||
// Most code here has been copied from the Go sources:
|
||||
// https://github.com/golang/go/blob/go1.12/src/syscall/syscall_js.go
|
||||
// It has the following copyright note:
|
||||
@@ -25,6 +29,20 @@ const (
|
||||
SIGTERM
|
||||
)
|
||||
|
||||
func (s Signal) Signal() {}
|
||||
|
||||
func (s Signal) String() string {
|
||||
if 0 <= s && int(s) < len(signals) {
|
||||
str := signals[s]
|
||||
if str != "" {
|
||||
return str
|
||||
}
|
||||
}
|
||||
return "signal " + itoa.Itoa(int(s))
|
||||
}
|
||||
|
||||
var signals = [...]string{}
|
||||
|
||||
// File system
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user