Skip to content

Commit b77b37a

Browse files
committed
s/pselect6Sigset_t/sigset_argpack/g
1 parent 3c1041b commit b77b37a

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

unix/linux/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ const (
968968
)
969969

970970
type Sigset_t C.sigset_t
971-
type pselect6Sigset_t struct {
971+
type sigset_argpack struct {
972972
ss *Sigset_t
973973
ssLen uintptr // Size (in bytes) of object pointed to by ss.
974974
}

unix/syscall_linux.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ func Getpgrp() (pid int) {
18851885
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
18861886
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
18871887
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
1888-
//sys pselect6(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *pselect6Sigset_t) (n int, err error)
1888+
//sys pselect6(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *sigset_argpack) (n int, err error)
18891889
//sys read(fd int, p []byte) (n int, err error)
18901890
//sys Removexattr(path string, attr string) (err error)
18911891
//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)
@@ -2450,16 +2450,17 @@ func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *
24502450

24512451
// The final argument of the pselect6() system call is not a
24522452
// sigset_t * pointer, but is instead a structure
2453-
var kernelMask *pselect6Sigset_t
2453+
var kernelMask *sigset_argpack
24542454
if sigmask != nil {
2455-
wordBits := 32 << (^uintptr(0) >> 63)
2456-
sigsetWords := (_C__NSIG - 1 + wordBits - 1) / (wordBits)
2455+
wordBits := 32 << (^uintptr(0) >> 63) // see math.intSize
24572456

24582457
// A sigset stores one bit per signal,
24592458
// offset by 1 (because signal 0 does not exist).
24602459
// So the number of words needed is ⌈__C_NSIG - 1 / wordBits⌉.
2460+
sigsetWords := (_C__NSIG - 1 + wordBits - 1) / (wordBits)
2461+
24612462
sigsetBytes := sigsetWords * (wordBits / 8)
2462-
kernelMask = &pselect6Sigset_t{
2463+
kernelMask = &sigset_argpack{
24632464
ss: sigmask,
24642465
ssLen: uintptr(sigsetBytes),
24652466
}

unix/zsyscall_linux.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)