Skip to content

Commit fb64370

Browse files
committed
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.
1 parent 38e3d55 commit fb64370

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

loader/goroot.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
269269

270270
if needsSyscallPackage {
271271
paths["syscall/"] = true // include syscall/js
272+
paths["internal/syscall/"] = true
273+
paths["internal/syscall/unix/"] = false
272274
}
273275
return paths
274276
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package unix
2+
3+
type GetRandomFlag uintptr
4+
5+
const (
6+
GRND_NONBLOCK GetRandomFlag = 0x0001
7+
GRND_RANDOM GetRandomFlag = 0x0002
8+
)
9+
10+
func GetRandom(p []byte, flags GetRandomFlag) (n int, err error) {
11+
panic("todo: unix.GetRandom")
12+
}

0 commit comments

Comments
 (0)