Files
lchandHan-Wen Nienhuys 497617f764 fuse: add functional support for FreeBSD
fuse: merge attr definition of Darwin and FreeBSD

Change-Id: I7229229aed8afad74089bc2ce7eff0b86bd2ccd0
2024-04-12 09:30:06 +00:00

28 lines
512 B
Go

//go:build !darwin
package fuse
import (
"path/filepath"
"syscall"
"golang.org/x/sys/unix"
)
func pollHack(mountPoint string) error {
fd, err := syscall.Open(filepath.Join(mountPoint, pollHackName), syscall.O_RDONLY, 0)
if err != nil {
return err
}
pollData := []unix.PollFd{{
Fd: int32(fd),
Events: unix.POLLIN | unix.POLLPRI | unix.POLLOUT,
}}
// Trigger _OP_POLL, so we can say ENOSYS. We don't care about
// the return value.
unix.Poll(pollData, 0)
syscall.Close(fd)
return nil
}