Skip to content

Commit 2934436

Browse files
committed
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 <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matt Layher <[email protected]>
1 parent 0a7ae4b commit 2934436

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

unix/syscall_linux_amd64.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ package unix
2121
//sysnb Getgid() (gid int)
2222
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
2323
//sysnb Getuid() (uid int)
24-
//sysnb inotifyInit() (fd int, err error)
2524

2625
func InotifyInit() (fd int, err error) {
27-
// First try inotify_init1, because Android's seccomp policy blocks the latter.
28-
fd, err = InotifyInit1(0)
29-
if err == ENOSYS {
30-
fd, err = inotifyInit()
31-
}
32-
return
26+
return InotifyInit1(0)
3327
}
3428

3529
//sys Ioperm(from int, num int, on int) (err error)

unix/zsyscall_linux_amd64.go

-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)