summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevon H. O'Dell <devon.odell@gmail.com>2010-01-05 09:21:15 -0800
committerDevon H. O'Dell <devon.odell@gmail.com>2010-01-05 09:21:15 -0800
commitf74750aed1b86c7698a09bf46697fc683745866d (patch)
tree5469556d8aae4517bd337119375afce009646ef6
parenta630bd236bfd67500d3ab70194aa161f2f2670eb (diff)
downloadgolang-f74750aed1b86c7698a09bf46697fc683745866d.tar.gz
syscall: add nanosleep on FreeBSD
Fixes issue 461 R=rsc CC=golang-dev http://codereview.appspot.com/181059 Committer: Russ Cox <rsc@golang.org>
-rw-r--r--src/pkg/syscall/syscall_freebsd.go1
-rw-r--r--src/pkg/syscall/zsyscall_freebsd_386.go6
-rw-r--r--src/pkg/syscall/zsyscall_freebsd_amd64.go6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/pkg/syscall/syscall_freebsd.go b/src/pkg/syscall/syscall_freebsd.go
index 9b4ecd320..4a187dd89 100644
--- a/src/pkg/syscall/syscall_freebsd.go
+++ b/src/pkg/syscall/syscall_freebsd.go
@@ -520,6 +520,7 @@ func SysctlUint32(name string) (value uint32, errno int) {
//sys Mkdir(path string, mode int) (errno int)
//sys Mkfifo(path string, mode int) (errno int)
//sys Mknod(path string, mode int, dev int) (errno int)
+//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
//sys Open(path string, mode int, perm int) (fd int, errno int)
//sys Pathconf(path string, name int) (val int, errno int)
//sys Pread(fd int, p []byte, offset int64) (n int, errno int)
diff --git a/src/pkg/syscall/zsyscall_freebsd_386.go b/src/pkg/syscall/zsyscall_freebsd_386.go
index 99f23d0fc..8216dc760 100644
--- a/src/pkg/syscall/zsyscall_freebsd_386.go
+++ b/src/pkg/syscall/zsyscall_freebsd_386.go
@@ -425,6 +425,12 @@ func Mknod(path string, mode int, dev int) (errno int) {
return
}
+func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+ _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
+ errno = int(e1)
+ return
+}
+
func Open(path string, mode int, perm int) (fd int, errno int) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)
diff --git a/src/pkg/syscall/zsyscall_freebsd_amd64.go b/src/pkg/syscall/zsyscall_freebsd_amd64.go
index a670ce149..ccae89b3b 100644
--- a/src/pkg/syscall/zsyscall_freebsd_amd64.go
+++ b/src/pkg/syscall/zsyscall_freebsd_amd64.go
@@ -425,6 +425,12 @@ func Mknod(path string, mode int, dev int) (errno int) {
return
}
+func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
+ _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
+ errno = int(e1)
+ return
+}
+
func Open(path string, mode int, perm int) (fd int, errno int) {
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
fd = int(r0)