Commit 82cd6e7b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Update for weekly 2012-02.14

parent 1ea7b36d
......@@ -113,11 +113,11 @@ func (me *LoopbackFile) Release() {
}
func (me *LoopbackFile) Fsync(*FsyncIn) (code Status) {
return ToStatus(syscall.Fsync(me.File.Fd()))
return ToStatus(syscall.Fsync(int(me.File.Fd())))
}
func (me *LoopbackFile) Truncate(size uint64) Status {
return ToStatus(syscall.Ftruncate(me.File.Fd(), int64(size)))
return ToStatus(syscall.Ftruncate(int(me.File.Fd()), int64(size)))
}
// futimens missing from 6g runtime.
......@@ -132,7 +132,7 @@ func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status {
func (me *LoopbackFile) GetAttr() (*Attr, Status) {
st := syscall.Stat_t{}
err := syscall.Fstat(me.File.Fd(), &st)
err := syscall.Fstat(int(me.File.Fd()), &st)
if err != nil {
return nil, ToStatus(err)
}
......
......@@ -39,7 +39,7 @@ func ToStatus(err error) Status {
case syscall.Errno:
return Status(t)
case *os.SyscallError:
return Status(t.Errno.(syscall.Errno))
return Status(t.Err.(syscall.Errno))
case *os.PathError:
return ToStatus(t.Err)
case *os.LinkError:
......
......@@ -19,8 +19,8 @@ func unixgramSocketpair() (l, r *os.File, err error) {
return nil, nil, os.NewSyscallError("socketpair",
err.(syscall.Errno))
}
l = os.NewFile(fd[0], "socketpair-half1")
r = os.NewFile(fd[1], "socketpair-half2")
l = os.NewFile(uintptr(fd[0]), "socketpair-half1")
r = os.NewFile(uintptr(fd[1]), "socketpair-half2")
return
}
......@@ -118,7 +118,7 @@ func getConnection(local *os.File) (f *os.File, err error) {
// n, oobn, recvflags, from, errno - todo: error checking.
_, oobn, _, _,
err := syscall.Recvmsg(
local.Fd(), data[:], control[:], 0)
int(local.Fd()), data[:], control[:], 0)
if err != nil {
return
}
......@@ -138,7 +138,7 @@ func getConnection(local *os.File) (f *os.File, err error) {
err = fmt.Errorf("getConnection: fd < 0: %d", fd)
return
}
f = os.NewFile(int(fd), "<fuseConnection>")
f = os.NewFile(uintptr(fd), "<fuseConnection>")
return
}
......
......@@ -272,7 +272,7 @@ func (me *MountState) write(req *request) Status {
if req.flatData == nil {
_, err = me.mountFile.Write(req.outHeaderBytes)
} else {
_, err = Writev(me.mountFile.Fd(),
_, err = Writev(int(me.mountFile.Fd()),
[][]byte{req.outHeaderBytes, req.flatData})
}
......
......@@ -24,11 +24,11 @@ func init() {
os.O_WRONLY: "WRONLY",
os.O_RDWR: "RDWR",
os.O_APPEND: "APPEND",
os.O_ASYNC: "ASYNC",
syscall.O_ASYNC: "ASYNC",
os.O_CREATE: "CREAT",
os.O_EXCL: "EXCL",
os.O_NOCTTY: "NOCTTY",
os.O_NONBLOCK: "NONBLOCK",
syscall.O_NOCTTY: "NOCTTY",
syscall.O_NONBLOCK: "NONBLOCK",
os.O_SYNC: "SYNC",
os.O_TRUNC: "TRUNC",
......
package fuse
// #include <linux/fuse.h>
import "C"
import (
"os"
"syscall"
)
const (
FUSE_ROOT_ID = 1
......
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