Commit 047be3fa authored by Ivan Krasin's avatar Ivan Krasin

Use syscall.Msghdr. Test PASS

parent 61493549
......@@ -88,24 +88,14 @@ func (m *MountPoint) Unmount() (err os.Error) {
return
}
func recvmsg(fd int, msg *msghdr, flags int) (n int, errno int) {
func recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, errno int) {
n1, _, e1 := syscall.Syscall(syscall.SYS_RECVMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(n1)
errno = int(e1)
return
}
type msghdr struct {
Name uintptr
Namelen uintptr
Iov uintptr
Iovlen uintptr
Control uintptr
Controllen uintptr
Flags uintptr
}
func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) {
func Recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, err os.Error) {
fmt.Printf("Recvmsg, 0\n")
n, errno := recvmsg(fd, msg, flags)
fmt.Printf("Recvmsg, 10\n")
......@@ -116,17 +106,17 @@ func Recvmsg(fd int, msg *msghdr, flags int) (n int, err os.Error) {
}
func getFuseConn(local net.Conn) (f * os.File, err os.Error) {
var msg msghdr
var msg syscall.Msghdr
var iov syscall.Iovec
base := make([]int32, 256)
control := make([]int32, 256)
iov.Base = (*byte)(unsafe.Pointer(&base[0]))
iov.Len = uint64(len(base) * 4)
msg.Iov = uintptr(unsafe.Pointer(&iov))
msg.Iov = (*syscall.Iovec)(unsafe.Pointer(&iov))
msg.Iovlen = 1
msg.Control = uintptr(unsafe.Pointer(&control[0]))
msg.Controllen = uintptr(len(control) * 4)
msg.Control = (*byte)(unsafe.Pointer(&control[0]))
msg.Controllen = uint64(len(control) * 4)
_, err = Recvmsg(local.File().Fd(), &msg, 0)
fmt.Printf("getFuseConn: 100\n")
......
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