]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: make getdirentries work on netbsd
authorJoel Sing <jsing@google.com>
Thu, 22 Dec 2011 12:42:43 +0000 (23:42 +1100)
committerJoel Sing <jsing@google.com>
Thu, 22 Dec 2011 12:42:43 +0000 (23:42 +1100)
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5504068

src/pkg/syscall/syscall_netbsd.go
src/pkg/syscall/zsyscall_netbsd_386.go
src/pkg/syscall/zsyscall_netbsd_amd64.go
src/pkg/syscall/ztypes_netbsd_386.go
src/pkg/syscall/ztypes_netbsd_amd64.go

index eb1a78a1130cc62d1b0e14e16b6853a3c598e750..f122c6224926b9ad22b98f4b576671fe6dd16c9f 100644 (file)
@@ -74,13 +74,13 @@ func Pipe(p []int) (err error) {
        return
 }
 
-// TODO
-func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
-       return -1, ENOSYS
+//sys getdents(fd int, buf []byte) (n int, err error)
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+       return getdents(fd, buf)
 }
 
 // TODO
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
        return -1, ENOSYS
 }
 
@@ -176,7 +176,6 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
 // __fhstatvfs140
 // __fstat30
 // __getcwd
-// __getdents30
 // __getfh30
 // __getlogin
 // __lstat30
index 6520a7fe78d68befb460a54aa8b1b6835fad2a72..61fb8b5b4f1e7905d6aa99acefbd205aeb5166cd 100644 (file)
@@ -263,6 +263,23 @@ func pipe(p *[2]_C_int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func getdents(fd int, buf []byte) (n int, err error) {
+       var _p0 unsafe.Pointer
+       if len(buf) > 0 {
+               _p0 = unsafe.Pointer(&buf[0])
+       } else {
+               _p0 = unsafe.Pointer(&_zero)
+       }
+       r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
+       n = int(r0)
+       if e1 != 0 {
+               err = e1
+       }
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Access(path string, mode uint32) (err error) {
        _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
        if e1 != 0 {
index 94fbc83be2421c9462048e968e3909662108b275..e665aa00981f1c2ba365879629c992dad0620972 100644 (file)
@@ -263,6 +263,23 @@ func pipe(p *[2]_C_int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func getdents(fd int, buf []byte) (n int, err error) {
+       var _p0 unsafe.Pointer
+       if len(buf) > 0 {
+               _p0 = unsafe.Pointer(&buf[0])
+       } else {
+               _p0 = unsafe.Pointer(&_zero)
+       }
+       r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
+       n = int(r0)
+       if e1 != 0 {
+               err = e1
+       }
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Access(path string, mode uint32) (err error) {
        _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
        if e1 != 0 {
index 04e7bad67a448ba8566987d67b62f7bcae051f56..ef9f33aeba1eca0b77966374d4acd310638e0f9c 100644 (file)
@@ -127,11 +127,11 @@ type Flock_t struct {
 }
 
 type Dirent struct {
-       Fileno uint32
+       Fileno uint64
        Reclen uint16
+       Namlen uint16
        Type   uint8
-       Namlen uint8
-       Name   [256]int8
+       Name   [512]int8
 }
 
 type Fsid struct {
index 1aabee5d4df34350d9bd478eaff0cb701b592de0..3979d54def1a7ae856cb5eca4cdb3b6e14f58c2d 100644 (file)
@@ -130,11 +130,11 @@ type Flock_t struct {
 }
 
 type Dirent struct {
-       Fileno uint32
+       Fileno uint64
        Reclen uint16
+       Namlen uint16
        Type   uint8
-       Namlen uint8
-       Name   [256]int8
+       Name   [512]int8
 }
 
 type Fsid struct {