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>
This commit is contained in:
Lorenz Bauer
2022-09-28 08:41:32 +00:00
committed by Gopher Robot
parent d9d178bc13
commit c57c793909
16 changed files with 96 additions and 0 deletions

View File

@@ -959,6 +959,12 @@ type Sigset_t C.sigset_t
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

View File

@@ -254,6 +254,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -269,6 +269,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -245,6 +245,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -248,6 +248,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -249,6 +249,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -250,6 +250,12 @@ type Sigset_t struct {
const _C__NSIG = 0x80
const (
SIG_BLOCK = 0x1
SIG_UNBLOCK = 0x2
SIG_SETMASK = 0x3
)
type Siginfo struct {
Signo int32
Code int32

View File

@@ -251,6 +251,12 @@ type Sigset_t struct {
const _C__NSIG = 0x80
const (
SIG_BLOCK = 0x1
SIG_UNBLOCK = 0x2
SIG_SETMASK = 0x3
)
type Siginfo struct {
Signo int32
Code int32

View File

@@ -251,6 +251,12 @@ type Sigset_t struct {
const _C__NSIG = 0x80
const (
SIG_BLOCK = 0x1
SIG_UNBLOCK = 0x2
SIG_SETMASK = 0x3
)
type Siginfo struct {
Signo int32
Code int32

View File

@@ -250,6 +250,12 @@ type Sigset_t struct {
const _C__NSIG = 0x80
const (
SIG_BLOCK = 0x1
SIG_UNBLOCK = 0x2
SIG_SETMASK = 0x3
)
type Siginfo struct {
Signo int32
Code int32

View File

@@ -257,6 +257,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -258,6 +258,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -258,6 +258,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -276,6 +276,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -271,6 +271,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x0
SIG_UNBLOCK = 0x1
SIG_SETMASK = 0x2
)
type Siginfo struct {
Signo int32
Errno int32

View File

@@ -253,6 +253,12 @@ type Sigset_t struct {
const _C__NSIG = 0x41
const (
SIG_BLOCK = 0x1
SIG_UNBLOCK = 0x2
SIG_SETMASK = 0x4
)
type Siginfo struct {
Signo int32
Errno int32