Skip to content

Commit

Permalink
hooks/go123: support os.Getpagesize
Browse files Browse the repository at this point in the history
For bolt.
  • Loading branch information
jellevandenhooff committed Nov 22, 2024
1 parent 6dab2de commit 276c7f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/hooks/go123/syscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func Syscall_hasWaitingReaders(rw *sync.RWMutex) bool {
}

func Syscall_Getpagesize() int {
panic("gosim not implemented")
// TODO: support bigger pages optionally? flip per architecture?
return 4096
}

func Syscall_Exit(code int) {
Expand Down
6 changes: 6 additions & 0 deletions internal/tests/behavior/os_sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ func TestMachineHostname(t *testing.T) {

m.Wait()
}

func TestGetpagesize(t *testing.T) {
if pgsize := os.Getpagesize(); pgsize != 4096 {
t.Fatalf("bad page size %d", pgsize)
}
}

0 comments on commit 276c7f5

Please sign in to comment.