Files
wazero/internal/sysfs/open_file_js.go
Crypt Keeper 34324031cb extracts FS interfaces into fsapi package and consolidates impls (#1477)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Co-authored-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
2023-05-17 07:19:54 +03:00

20 lines
477 B
Go

package sysfs
import (
"io/fs"
"os"
"syscall"
"github.com/tetratelabs/wazero/internal/platform"
)
func newOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) File {
return newDefaultOsFile(openPath, openFlag, openPerm, f)
}
func openFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) {
flag &= ^(O_DIRECTORY | O_NOFOLLOW) // erase placeholders
f, err := os.OpenFile(path, flag, perm)
return f, platform.UnwrapOSError(err)
}