diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2022-08-09 10:20:22 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-08-18 16:08:26 +0000 |
| commit | 021fd86ce12ac694db778f6998d12c1e8d8c63ca (patch) | |
| tree | 50816a22bc965b2147917522f560e19c674b3091 /src/syscall/syscall_linux_arm64.go | |
| parent | 741ab7e819538ef84ce7a2e560730c6212e95161 (diff) | |
| download | go-021fd86ce12ac694db778f6998d12c1e8d8c63ca.tar.xz | |
syscall: implement EpollCreate using EpollCreate1 on all linux platforms
Most newer architectures (e.g. arm64, riscv64, loong64) don't provide the
epoll_create syscall. Some systems (e.g. Android) block it even if it
were available. In the kernel, the epoll_create syscall is implemented
[1] the same way EpollCreate is implemented in this package for
platforms without the epoll_create syscall. The epoll_create1 syscall is
available since Linux kernel 2.6.27 and the minimum required kernel
version is 2.6.32 since Go 1.18 (see #45964). Thus, avoid the separate
wrapper and consistently implement EpollCreate using EpollCreate1.
[1] https://elixir.bootlin.com/linux/v5.15-rc1/source/fs/eventpoll.c#L2006
The same change was already done in CL 349809 for golang.org/x/sys/unix.
For #45964
Change-Id: I5463b208aa7ae236fa2c175d6d3ec6568f1840b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/411594
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/syscall/syscall_linux_arm64.go')
| -rw-r--r-- | src/syscall/syscall_linux_arm64.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/syscall/syscall_linux_arm64.go b/src/syscall/syscall_linux_arm64.go index 1ccbad1b75..6b482adcfd 100644 --- a/src/syscall/syscall_linux_arm64.go +++ b/src/syscall/syscall_linux_arm64.go @@ -8,13 +8,6 @@ import "unsafe" const _SYS_setgroups = SYS_SETGROUPS -func EpollCreate(size int) (fd int, err error) { - if size <= 0 { - return -1, EINVAL - } - return EpollCreate1(0) -} - //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) |
