unix: add SIG_BLOCK and friends for Linux

The recently added PthreadSigmask syscall expects a parameter
how that specifies which action to perform on the thread's signal
set. The value of this parameter differs between arches. Add the
SIG_* constants to have a portable source.

Updates golang/go#55349

Change-Id: I7cb42d7c2c42e9b3d22123e8de74960121d89313
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435775
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
diff --git a/unix/linux/types.go b/unix/linux/types.go
index 2287618..38cfb27 100644
--- a/unix/linux/types.go
+++ b/unix/linux/types.go
@@ -959,6 +959,12 @@
 
 const _C__NSIG = C._NSIG
 
+const (
+	SIG_BLOCK   = C.SIG_BLOCK
+	SIG_UNBLOCK = C.SIG_UNBLOCK
+	SIG_SETMASK = C.SIG_SETMASK
+)
+
 type SignalfdSiginfo C.struct_signalfd_siginfo
 
 type Siginfo C.siginfo_t
diff --git a/unix/ztypes_linux_386.go b/unix/ztypes_linux_386.go
index 2636044..89c516a 100644
--- a/unix/ztypes_linux_386.go
+++ b/unix/ztypes_linux_386.go
@@ -254,6 +254,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_amd64.go b/unix/ztypes_linux_amd64.go
index 8187489..62b4fb2 100644
--- a/unix/ztypes_linux_amd64.go
+++ b/unix/ztypes_linux_amd64.go
@@ -269,6 +269,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_arm.go b/unix/ztypes_linux_arm.go
index d161233..e86b358 100644
--- a/unix/ztypes_linux_arm.go
+++ b/unix/ztypes_linux_arm.go
@@ -245,6 +245,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_arm64.go b/unix/ztypes_linux_arm64.go
index c28e555..6c6be4c 100644
--- a/unix/ztypes_linux_arm64.go
+++ b/unix/ztypes_linux_arm64.go
@@ -248,6 +248,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_loong64.go b/unix/ztypes_linux_loong64.go
index 187061f..4982ea3 100644
--- a/unix/ztypes_linux_loong64.go
+++ b/unix/ztypes_linux_loong64.go
@@ -249,6 +249,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_mips.go b/unix/ztypes_linux_mips.go
index 3691299..173141a 100644
--- a/unix/ztypes_linux_mips.go
+++ b/unix/ztypes_linux_mips.go
@@ -250,6 +250,12 @@
 
 const _C__NSIG = 0x80
 
+const (
+	SIG_BLOCK   = 0x1
+	SIG_UNBLOCK = 0x2
+	SIG_SETMASK = 0x3
+)
+
 type Siginfo struct {
 	Signo int32
 	Code  int32
diff --git a/unix/ztypes_linux_mips64.go b/unix/ztypes_linux_mips64.go
index 7473468..93ae4c5 100644
--- a/unix/ztypes_linux_mips64.go
+++ b/unix/ztypes_linux_mips64.go
@@ -251,6 +251,12 @@
 
 const _C__NSIG = 0x80
 
+const (
+	SIG_BLOCK   = 0x1
+	SIG_UNBLOCK = 0x2
+	SIG_SETMASK = 0x3
+)
+
 type Siginfo struct {
 	Signo int32
 	Code  int32
diff --git a/unix/ztypes_linux_mips64le.go b/unix/ztypes_linux_mips64le.go
index ed94485..4e4e510 100644
--- a/unix/ztypes_linux_mips64le.go
+++ b/unix/ztypes_linux_mips64le.go
@@ -251,6 +251,12 @@
 
 const _C__NSIG = 0x80
 
+const (
+	SIG_BLOCK   = 0x1
+	SIG_UNBLOCK = 0x2
+	SIG_SETMASK = 0x3
+)
+
 type Siginfo struct {
 	Signo int32
 	Code  int32
diff --git a/unix/ztypes_linux_mipsle.go b/unix/ztypes_linux_mipsle.go
index 0892a73..3f5ba01 100644
--- a/unix/ztypes_linux_mipsle.go
+++ b/unix/ztypes_linux_mipsle.go
@@ -250,6 +250,12 @@
 
 const _C__NSIG = 0x80
 
+const (
+	SIG_BLOCK   = 0x1
+	SIG_UNBLOCK = 0x2
+	SIG_SETMASK = 0x3
+)
+
 type Siginfo struct {
 	Signo int32
 	Code  int32
diff --git a/unix/ztypes_linux_ppc.go b/unix/ztypes_linux_ppc.go
index e1dd483..71dfe7c 100644
--- a/unix/ztypes_linux_ppc.go
+++ b/unix/ztypes_linux_ppc.go
@@ -257,6 +257,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_ppc64.go b/unix/ztypes_linux_ppc64.go
index d9f654c..3a2b7f0 100644
--- a/unix/ztypes_linux_ppc64.go
+++ b/unix/ztypes_linux_ppc64.go
@@ -258,6 +258,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_ppc64le.go b/unix/ztypes_linux_ppc64le.go
index 74acda9..a52d627 100644
--- a/unix/ztypes_linux_ppc64le.go
+++ b/unix/ztypes_linux_ppc64le.go
@@ -258,6 +258,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_riscv64.go b/unix/ztypes_linux_riscv64.go
index 50ebe69..dfc007d 100644
--- a/unix/ztypes_linux_riscv64.go
+++ b/unix/ztypes_linux_riscv64.go
@@ -276,6 +276,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_s390x.go b/unix/ztypes_linux_s390x.go
index 75b34c2..b53cb91 100644
--- a/unix/ztypes_linux_s390x.go
+++ b/unix/ztypes_linux_s390x.go
@@ -271,6 +271,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x0
+	SIG_UNBLOCK = 0x1
+	SIG_SETMASK = 0x2
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32
diff --git a/unix/ztypes_linux_sparc64.go b/unix/ztypes_linux_sparc64.go
index 429c3bf..fe0aa35 100644
--- a/unix/ztypes_linux_sparc64.go
+++ b/unix/ztypes_linux_sparc64.go
@@ -253,6 +253,12 @@
 
 const _C__NSIG = 0x41
 
+const (
+	SIG_BLOCK   = 0x1
+	SIG_UNBLOCK = 0x2
+	SIG_SETMASK = 0x4
+)
+
 type Siginfo struct {
 	Signo int32
 	Errno int32