diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-09 08:19:58 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-09 08:19:58 +0000 |
commit | 2da6f72bb78de6e6ca3d387d970cb21bf36684be (patch) | |
tree | 7ca86535c5a6b99d4cc432ba5cfddabc5ee4ea16 /libgo/go/syscall/syscall.go | |
parent | 98ea39f2b59cc0a4a0a32b095e8f0faa84fd7882 (diff) | |
download | ppe42-gcc-2da6f72bb78de6e6ca3d387d970cb21bf36684be.tar.gz ppe42-gcc-2da6f72bb78de6e6ca3d387d970cb21bf36684be.zip |
libgo: Update to weekly.2012-02-07.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/syscall/syscall.go')
-rw-r--r-- | libgo/go/syscall/syscall.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libgo/go/syscall/syscall.go b/libgo/go/syscall/syscall.go index f7771978992..4efaaec3bd2 100644 --- a/libgo/go/syscall/syscall.go +++ b/libgo/go/syscall/syscall.go @@ -33,6 +33,7 @@ func StringBytePtr(s string) *byte { return &StringByteSlice(s)[0] } var _zero uintptr var dummy *byte + const sizeofPtr uintptr = uintptr(unsafe.Sizeof(dummy)) func (ts *Timespec) Unix() (sec int64, nsec int64) { @@ -42,3 +43,11 @@ func (ts *Timespec) Unix() (sec int64, nsec int64) { func (tv *Timeval) Unix() (sec int64, nsec int64) { return int64(tv.Sec), int64(tv.Usec) * 1000 } + +func (ts *Timespec) Nano() int64 { + return int64(ts.Sec)*1e9 + int64(ts.Nsec) +} + +func (tv *Timeval) Nano() int64 { + return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 +} |