Files
go-fuse/fs/dirstream_darwin.go
Han-Wen Nienhuys a92310eb88 fs: on Darwin, read direntries directly from the file descriptor.
For some reason, the x/sys/ package does not provide unix.Getdents on
Darwin, but does provide unix.Getdirentries(), which is a BSD (?) flavor
of the same? It takes a basep argument which is ignored.

Fixes https://github.com/hanwen/go-fuse/issues/566

Change-Id: Id000000049819d114496fca39cb947fb8bd5c210
2025-04-28 06:33:26 +00:00

12 lines
301 B
Go

// Copyright 2019 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fs
import "golang.org/x/sys/unix"
func getdents(fd int, buf []byte) (int, error) {
return unix.Getdirentries(fd, buf, nil)
}