Commit 61493549 authored by Ivan Krasin's avatar Ivan Krasin

Use syscall.Iovec. Test PASS

parent aab0374f
...@@ -105,11 +105,6 @@ type msghdr struct { ...@@ -105,11 +105,6 @@ type msghdr struct {
Flags uintptr Flags uintptr
} }
type iovec struct {
Base uintptr
Len uintptr
}
func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) { func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) {
fmt.Printf("Recvmsg, 0\n") fmt.Printf("Recvmsg, 0\n")
n, errno := recvmsg(fd, msg, flags) n, errno := recvmsg(fd, msg, flags)
...@@ -122,12 +117,12 @@ func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) { ...@@ -122,12 +117,12 @@ func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) {
func getFuseConn(local net.Conn) (f * os.File, err os.Error) { func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
var msg msghdr var msg msghdr
var iov iovec var iov syscall.Iovec
base := make([]int32, 256) base := make([]int32, 256)
control := make([]int32, 256) control := make([]int32, 256)
iov.Base = uintptr(unsafe.Pointer(&base[0])) iov.Base = (*byte)(unsafe.Pointer(&base[0]))
iov.Len = uintptr(len(base) * 4) iov.Len = uint64(len(base) * 4)
msg.Iov = uintptr(unsafe.Pointer(&iov)) msg.Iov = uintptr(unsafe.Pointer(&iov))
msg.Iovlen = 1 msg.Iovlen = 1
msg.Control = uintptr(unsafe.Pointer(&control[0])) msg.Control = uintptr(unsafe.Pointer(&control[0]))
...@@ -158,6 +153,7 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) { ...@@ -158,6 +153,7 @@ func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
err = os.NewError(fmt.Sprintf("getFuseConn: fd < 0: %d", fd)) err = os.NewError(fmt.Sprintf("getFuseConn: fd < 0: %d", fd))
return return
} }
fmt.Printf("fd: %d\n", fd)
fmt.Printf("getFuseConn: 180\n") fmt.Printf("getFuseConn: 180\n")
f = os.NewFile(int(fd), "fuse-conn") f = os.NewFile(int(fd), "fuse-conn")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment