mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
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 <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
0a7ae4be8d
commit
2934436797
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user