Files
wazero/internal/platform/open_file_sun.go
Crypt Keeper e5dc733df7 Adds Path to platform.File and refactors tests (#1431)
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-04 07:05:40 +08:00

21 lines
441 B
Go

//go:build illumos || solaris
package platform
import (
"io/fs"
"os"
"syscall"
)
const (
// See https://github.com/illumos/illumos-gate/blob/edd580643f2cf1434e252cd7779e83182ea84945/usr/src/uts/common/sys/fcntl.h#L90
O_DIRECTORY = 0x1000000
O_NOFOLLOW = syscall.O_NOFOLLOW
)
func OpenFile(path string, flag int, perm fs.FileMode) (fs.File, syscall.Errno) {
f, err := os.OpenFile(path, flag, perm)
return f, UnwrapOSError(err)
}