unix: fix Signalfd function signature on linux

The kernel raw syscall takes an additional parameter specifying
the size of the Sigset_t parameter, returns a file descriptor and sets errno.

Add a uintptr maxSize parameter, adjust the return to be (newfd int, err error).
Add the _NSIG #define and a wrapper to call with maxSize set to _C__NSIG/8 as done
in glibc/musl.

Change-Id: I277db0aab5c12364533c26ea800b7f394ec83ae4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Yuval Pavel Zholkover
2019-05-28 01:25:30 +00:00
committed by Ian Lance Taylor
parent 9cd6430ef9
commit adf421d2ca
28 changed files with 111 additions and 27 deletions
+2
View File
@@ -804,6 +804,8 @@ const (
type Sigset_t C.sigset_t
const _C__NSIG = C._NSIG
type SignalfdSiginfo C.struct_signalfd_siginfo
const PERF_IOC_FLAG_GROUP = C.PERF_IOC_FLAG_GROUP