mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 14:47:28 -04:00
unix: fix Getdirentries emulation using Getdents on netbsd, openbsd
CL 182319 used the wrong shift offset, correct and enable the TestGetdirentries. Change-Id: I45d8d420a071fd79fa1b37642b984d80943f492b Reviewed-on: https://go-review.googlesource.com/c/sys/+/183221 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
d6ba46b060
commit
a26fa11ef6
@@ -106,7 +106,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
if unsafe.Sizeof(*basep) == 8 {
|
||||
return
|
||||
}
|
||||
if off>>4 != 0 {
|
||||
if off>>32 != 0 {
|
||||
// We can't stuff the offset back into a uintptr, so any
|
||||
// future calls would be suspect. Generate an error.
|
||||
// EIO was allowed by getdirentries.
|
||||
|
||||
Reference in New Issue
Block a user