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
+15
View File
@@ -4,6 +4,7 @@
package syscall
import (
"internal/itoa"
"unsafe"
)
@@ -82,6 +83,20 @@ const (
SIGTERM Signal = 0xf
)
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{}
const (
Stdin = 0
Stdout = 1