diff options
| author | David Symonds <dsymonds@golang.org> | 2009-06-03 03:25:34 -0700 |
|---|---|---|
| committer | David Symonds <dsymonds@golang.org> | 2009-06-03 03:25:34 -0700 |
| commit | e02d3e8ed17ab3d285c9c24c49312dad4cff2ed4 (patch) | |
| tree | 4881b78388ec48cdfb6e7c81311af7a15d03e0e1 /src/lib | |
| parent | ab3d40b271806cd3b322a841b71eaa7e6e3fd363 (diff) | |
| download | go-e02d3e8ed17ab3d285c9c24c49312dad4cff2ed4.tar.xz | |
Define os.PageSize and syscall.PageSize.
R=rsc
APPROVED=rsc
DELTA=13 (13 added, 0 deleted, 0 changed)
OCL=29429
CL=29819
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/os/types.go | 5 | ||||
| -rw-r--r-- | src/lib/syscall/syscall_darwin_amd64.go | 4 | ||||
| -rw-r--r-- | src/lib/syscall/syscall_linux_amd64.go | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/os/types.go b/src/lib/os/types.go index 73363f4534..b5db866606 100644 --- a/src/lib/os/types.go +++ b/src/lib/os/types.go @@ -9,6 +9,11 @@ import "syscall" // An operating-system independent representation of Unix data structures. // OS-specific routines in this directory convert the OS-local versions to these. +// Getpagesize returns the underlying system's memory page size. +func Getpagesize() int{ + return syscall.Getpagesize() +} + // A Dir describes a file and is returned by Stat, Fstat, and Lstat type Dir struct { Dev uint64; // device number of file system holding file. diff --git a/src/lib/syscall/syscall_darwin_amd64.go b/src/lib/syscall/syscall_darwin_amd64.go index 31e91cda36..8620232230 100644 --- a/src/lib/syscall/syscall_darwin_amd64.go +++ b/src/lib/syscall/syscall_darwin_amd64.go @@ -6,6 +6,10 @@ package syscall import "syscall" +func Getpagesize() int { + return 4096 +} + func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec); } diff --git a/src/lib/syscall/syscall_linux_amd64.go b/src/lib/syscall/syscall_linux_amd64.go index 8b3404d3e3..24426405be 100644 --- a/src/lib/syscall/syscall_linux_amd64.go +++ b/src/lib/syscall/syscall_linux_amd64.go @@ -6,6 +6,10 @@ package syscall import "syscall" +func Getpagesize() int { + return 4096 +} + func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec); } |
