-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Adrian Cole <adrian@tetrate.io>
- Loading branch information
Adrian Cole
committed
Jul 19, 2023
1 parent
2d5cc36
commit baa3948
Showing
7 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package sysfs | ||
|
||
import ( | ||
"syscall" | ||
|
||
"github.com/tetratelabs/wazero/internal/fsapi" | ||
) | ||
|
||
const supportedSyscallOflag = fsapi.O_DIRECTORY | fsapi.O_NOFOLLOW | fsapi.O_NONBLOCK | ||
|
||
func withSyscallOflag(oflag fsapi.Oflag, flag int) int { | ||
if oflag&fsapi.O_DIRECTORY != 0 { | ||
flag |= syscall.O_DIRECTORY | ||
} | ||
// syscall.O_DSYNC not defined on darwin | ||
if oflag&fsapi.O_NOFOLLOW != 0 { | ||
flag |= syscall.O_NOFOLLOW | ||
} | ||
if oflag&fsapi.O_NONBLOCK != 0 { | ||
flag |= syscall.O_NONBLOCK | ||
} | ||
// syscall.O_RSYNC not defined on darwin | ||
return flag | ||
} |
2 changes: 0 additions & 2 deletions
2
internal/sysfs/open_file_unix.go → internal/sysfs/open_file_linux.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
//go:build linux || freebsd | ||
|
||
package sysfs | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !windows && !js && !illumos && !solaris | ||
//go:build !windows | ||
|
||
package sysfs | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters