Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/syscall/unix: use our own version of this package #4761

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions loader/goroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {

if needsSyscallPackage {
paths["syscall/"] = true // include syscall/js
paths["internal/syscall/"] = true
paths["internal/syscall/unix/"] = false
}
return paths
}
Expand Down
7 changes: 7 additions & 0 deletions src/internal/syscall/unix/constants.go
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
)
10 changes: 10 additions & 0 deletions src/internal/syscall/unix/eaccess.go
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
}
12 changes: 12 additions & 0 deletions src/internal/syscall/unix/getrandom.go
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")
}
Loading