summaryrefslogtreecommitdiff
path: root/src/syscall/zsyscall_freebsd_386.go
diff options
context:
space:
mode:
authorKeith Randall <keithr@alum.mit.edu>2019-06-08 12:57:59 -0400
committerKeith Randall <khr@golang.org>2019-06-10 16:18:32 +0000
commitdaf944a531fecf2431b60da608e70680f4927412 (patch)
tree2b8041f4ee6da222304e271b9c11b2ec93f5aafc /src/syscall/zsyscall_freebsd_386.go
parentec3ebf7bc31271b52c82b3fac193139b2788ed68 (diff)
downloadgo-git-daf944a531fecf2431b60da608e70680f4927412.tar.gz
syscall: fix Getdirentries on 32-bit freebsd 12
On freebsd 12, the system call for getdirentries writes 64 bits to *basep, even on 32-bit systems. Accomodate that by providing a uint64 to the system call and copy the base to/from that uint64. The uint64 seems to be a virtual file offset, so failing if the high bits are not zero should be fine for reasonable-sized directories. Fixes #32498 Change-Id: Ie22c0d301c6091bd20e813432928b24ab95cc314 Reviewed-on: https://go-review.googlesource.com/c/go/+/181377 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/syscall/zsyscall_freebsd_386.go')
-rw-r--r--src/syscall/zsyscall_freebsd_386.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syscall/zsyscall_freebsd_386.go b/src/syscall/zsyscall_freebsd_386.go
index 8f4234c7e9..ddc265f190 100644
--- a/src/syscall/zsyscall_freebsd_386.go
+++ b/src/syscall/zsyscall_freebsd_386.go
@@ -570,7 +570,7 @@ func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) {
+func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])