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
@@ -3,6 +3,10 @@
package syscall
import (
"internal/itoa"
)
// A Signal is a number describing a process signal.
// It implements the os.Signal interface.
type Signal int
@@ -17,6 +21,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 (