mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Define os.PageSize and syscall.PageSize.
R=rsc APPROVED=rsc DELTA=13 (13 added, 0 deleted, 0 changed) OCL=29429 CL=29819
This commit is contained in:
parent
ab3d40b271
commit
e02d3e8ed1
3 changed files with 13 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue