github.com/hanwen/go-fuse@v1.0.0/fuse/poll_linux.go (about)

     1  package fuse
     2  
     3  import (
     4  	"path/filepath"
     5  	"syscall"
     6  
     7  	"golang.org/x/sys/unix"
     8  )
     9  
    10  func pollHack(mountPoint string) error {
    11  	fd, err := syscall.Creat(filepath.Join(mountPoint, pollHackName), syscall.O_CREAT)
    12  	if err != nil {
    13  		return err
    14  	}
    15  	pollData := []unix.PollFd{{
    16  		Fd:     int32(fd),
    17  		Events: unix.POLLIN | unix.POLLPRI | unix.POLLOUT,
    18  	}}
    19  
    20  	// Trigger _OP_POLL, so we can say ENOSYS. We don't care about
    21  	// the return value.
    22  	unix.Poll(pollData, 0)
    23  	syscall.Close(fd)
    24  	return nil
    25  }