1package fsapi
2
3import experimentalsys "github.com/tetratelabs/wazero/experimental/sys"
4
5func Adapt(f experimentalsys.File) File {
6 if f, ok := f.(File); ok {
7 return f
8 }
9 return unimplementedFile{f}
10}
11
12type unimplementedFile struct{ experimentalsys.File }
13
14// IsNonblock implements File.IsNonblock
15func (unimplementedFile) IsNonblock() bool {
16 return false
17}
18
19// SetNonblock implements File.SetNonblock
20func (unimplementedFile) SetNonblock(bool) experimentalsys.Errno {
21 return experimentalsys.ENOSYS
22}
23
24// Poll implements File.Poll
25func (unimplementedFile) Poll(Pflag, int32) (ready bool, errno experimentalsys.Errno) {
26 return false, experimentalsys.ENOSYS
27}