github.com/sunvim/utils@v0.1.0/netpoll/poll_other.go (about) 1 // Copyright (c) 2020 Meng Huang (mhboy@outlook.com) 2 // This package is licensed under a MIT license that can be found in the LICENSE file. 3 4 //go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd 5 // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd 6 7 package netpoll 8 9 import ( 10 "errors" 11 "time" 12 ) 13 14 // Tag is the poll type. 15 var Tag = "none" 16 17 // Poll represents the poll that supports non-blocking I/O on file descriptors with polling. 18 type Poll struct { 19 } 20 21 // Create creates a new poll. 22 func Create() (*Poll, error) { 23 return nil, errors.New("system not supported") 24 } 25 26 // SetTimeout sets the wait timeout. 27 func (p *Poll) SetTimeout(d time.Duration) (err error) { 28 return nil 29 } 30 31 // Register registers a file descriptor. 32 func (p *Poll) Register(fd int) (err error) { 33 return 34 } 35 36 // Write adds a write event. 37 func (p *Poll) Write(fd int) (err error) { 38 return 39 } 40 41 // Unregister unregisters a file descriptor. 42 func (p *Poll) Unregister(fd int) (err error) { 43 return 44 } 45 46 // Wait waits events. 47 func (p *Poll) Wait(events []Event) (n int, err error) { 48 return 49 } 50 51 // Close closes the poll fd. The underlying file descriptor is closed by the 52 // destroy method when there are no remaining references. 53 func (p *Poll) Close() error { 54 return nil 55 }