unix: fix last argument of pselect6 on linux

On Linux, the last argument of pselect6 system call is **not** a
sigseg_t * pointer, but instead it is a structure of the form:

    struct {
        const sigset_t *ss;     /* Pointer to signal set */
        size_t          ss_len; /* Size (in bytes) of object pointed
    };

See man 2 pselect6.

Fixes #61251

Change-Id: Id0aa122a77796713bc6d624dc395d396fbc0c5e2
GitHub-Last-Rev: cb3c6d7da9b846843a4a81898ebfdcf2e449942a
GitHub-Pull-Request: golang/sys#167
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510195
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Mauri de Souza Meneguzzo
2023-07-19 00:01:56 +00:00
committed by Gopher Robot
parent 706fa9866a
commit 25d0004552
10 changed files with 67 additions and 7 deletions
+18
View File
@@ -444,6 +444,24 @@ func TestPselect(t *testing.T) {
}
}
func TestPselectWithSigmask(t *testing.T) {
var sigmask unix.Sigset_t
sigmask.Val[0] |= 1 << (uint(unix.SIGUSR1) - 1)
for {
n, err := unix.Pselect(0, nil, nil, nil, &unix.Timespec{Sec: 0, Nsec: 0}, &sigmask)
if err == unix.EINTR {
t.Logf("Pselect interrupted")
continue
} else if err != nil {
t.Fatalf("Pselect: %v", err)
}
if n != 0 {
t.Fatalf("Pselect: got %v ready file descriptors, expected 0", n)
}
break
}
}
func TestSchedSetaffinity(t *testing.T) {
var newMask unix.CPUSet
newMask.Zero()