diff --git a/src/syscall/syscall_freebsd.go b/src/syscall/syscall_freebsd.go index eecae8de30d..eb7208f5cc5 100644 --- a/src/syscall/syscall_freebsd.go +++ b/src/syscall/syscall_freebsd.go @@ -267,7 +267,7 @@ func Fstatfs(fd int, st *Statfs_t) (err error) { func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { if supportsABI(_ino64First) { - if unsafe.Sizeof(*basep) == 8 { + if basep == nil || unsafe.Sizeof(*basep) == 8 { return getdirentries_freebsd12(fd, buf, (*uint64)(unsafe.Pointer(basep))) } // The freebsd12 syscall needs a 64-bit base. On 32-bit machines