From 293443679730ccb83aaf2a90cff13c1ee0aa0cc2 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 2 Sep 2021 11:56:48 +0200 Subject: [PATCH] unix: drop fallback to inotifyInit in InotifyInit on linux/amd64 The minimum required Linux kernel version for Go 1.18 will be changed to 2.6.32, see golang/go#45964. The current minimum required version is 2.6.23 and the inotify_init1 syscall was added in 2.6.27, so the fallback to inotifyInit and inotifyInit itself can be removed on linux/amd64. For golang/go#45964 Change-Id: I8dc83ef04d74cfc9ec80da503076b9acfa9c365a Reviewed-on: https://go-review.googlesource.com/c/sys/+/347330 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Matt Layher --- unix/syscall_linux_amd64.go | 8 +------- unix/zsyscall_linux_amd64.go | 11 ----------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/unix/syscall_linux_amd64.go b/unix/syscall_linux_amd64.go index 85cd97da..c77f768b 100644 --- a/unix/syscall_linux_amd64.go +++ b/unix/syscall_linux_amd64.go @@ -21,15 +21,9 @@ package unix //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) -//sysnb inotifyInit() (fd int, err error) func InotifyInit() (fd int, err error) { - // First try inotify_init1, because Android's seccomp policy blocks the latter. - fd, err = InotifyInit1(0) - if err == ENOSYS { - fd, err = inotifyInit() - } - return + return InotifyInit1(0) } //sys Ioperm(from int, num int, on int) (err error) diff --git a/unix/zsyscall_linux_amd64.go b/unix/zsyscall_linux_amd64.go index 9919d848..c62e1d0f 100644 --- a/unix/zsyscall_linux_amd64.go +++ b/unix/zsyscall_linux_amd64.go @@ -191,17 +191,6 @@ func Getuid() (uid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func inotifyInit() (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) - fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 {