1
0
mirror of https://github.com/golang/go synced 2024-11-21 16:24:40 -07:00

syscall: make getdirentries work on netbsd

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5504068
This commit is contained in:
Joel Sing 2011-12-22 23:42:43 +11:00
parent 019d78e548
commit 43bc8a9b53
5 changed files with 44 additions and 11 deletions

View 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

View 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 {

View 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 {

View 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 {

View 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 {