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:
Elliott Sales de Andrade
2022-02-05 03:51:57 -05:00
committed by Ron Evans
parent e49e93f22c
commit bc098da93f
4 changed files with 66 additions and 0 deletions
+18
View File
@@ -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 (