-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/syscall/unix: use our own version of this package
The upstream one assumes it's running on a Unix system (which makes sense), but this package is also used on baremetal. So replace it on systems that need a replaced syscall package.
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package unix | ||
|
||
const ( | ||
R_OK = 0x4 | ||
W_OK = 0x2 | ||
X_OK = 0x1 | ||
) |
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,10 @@ | ||
package unix | ||
|
||
import "syscall" | ||
|
||
func Eaccess(path string, mode uint32) error { | ||
// We don't support this syscall on baremetal or wasm. | ||
// Callers are generally able to deal with this since unix.Eaccess also | ||
// isn't available on Android. | ||
return syscall.ENOSYS | ||
} |
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,12 @@ | ||
package unix | ||
|
||
type GetRandomFlag uintptr | ||
|
||
const ( | ||
GRND_NONBLOCK GetRandomFlag = 0x0001 | ||
GRND_RANDOM GetRandomFlag = 0x0002 | ||
) | ||
|
||
func GetRandom(p []byte, flags GetRandomFlag) (n int, err error) { | ||
panic("todo: unix.GetRandom") | ||
} |