Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
aab0374f
Commit
aab0374f
authored
Aug 11, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test PASS. Had to copy syscall structures to fuse.go
parent
dcd86912
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
fuse/fuse.go
fuse/fuse.go
+25
-10
fuse/fuse_test.go
fuse/fuse_test.go
+2
-2
No files found.
fuse/fuse.go
View file @
aab0374f
...
...
@@ -70,7 +70,7 @@ func (m *MountPoint) Unmount() (err os.Error) {
return
nil
}
pid
,
err
:=
os
.
ForkExec
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
"-u"
,
"m"
,
m
.
mountPoint
},
[]
string
{
"/bin/fusermount"
,
"-u"
,
m
.
mountPoint
},
nil
,
""
,
[]
*
os
.
File
{
nil
,
nil
,
os
.
Stderr
})
...
...
@@ -88,14 +88,29 @@ func (m *MountPoint) Unmount() (err os.Error) {
return
}
func
recvmsg
(
fd
int
,
msg
*
syscall
.
M
sghdr
,
flags
int
)
(
n
int
,
errno
int
)
{
func
recvmsg
(
fd
int
,
msg
*
m
sghdr
,
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
}
func
Recvmsg
(
fd
int
,
msg
*
syscall
.
Msghdr
,
flags
int
)
(
n
int
,
err
os
.
Error
)
{
type
msghdr
struct
{
Name
uintptr
Namelen
uintptr
Iov
uintptr
Iovlen
uintptr
Control
uintptr
Controllen
uintptr
Flags
uintptr
}
type
iovec
struct
{
Base
uintptr
Len
uintptr
}
func
Recvmsg
(
fd
int
,
msg
*
msghdr
,
flags
int
)
(
n
int
,
err
os
.
Error
)
{
fmt
.
Printf
(
"Recvmsg, 0
\n
"
)
n
,
errno
:=
recvmsg
(
fd
,
msg
,
flags
)
fmt
.
Printf
(
"Recvmsg, 10
\n
"
)
...
...
@@ -106,17 +121,17 @@ func Recvmsg(fd int, msg *syscall.Msghdr, flags int) (n int, err os.Error) {
}
func
getFuseConn
(
local
net
.
Conn
)
(
f
*
os
.
File
,
err
os
.
Error
)
{
var
msg
syscall
.
M
sghdr
var
iov
syscall
.
I
ovec
var
msg
m
sghdr
var
iov
i
ovec
base
:=
make
([]
int32
,
256
)
control
:=
make
([]
int32
,
256
)
iov
.
Base
=
(
*
byte
)(
unsafe
.
Pointer
(
&
base
))
iov
.
Len
=
uint
64
(
len
(
base
)
*
4
)
msg
.
Iov
=
&
iov
iov
.
Base
=
uintptr
(
unsafe
.
Pointer
(
&
base
[
0
]
))
iov
.
Len
=
uint
ptr
(
len
(
base
)
*
4
)
msg
.
Iov
=
uintptr
(
unsafe
.
Pointer
(
&
iov
))
msg
.
Iovlen
=
1
msg
.
Control
=
(
*
byte
)(
unsafe
.
Pointer
(
&
control
))
msg
.
Controllen
=
uint
64
(
len
(
control
)
*
4
)
msg
.
Control
=
uintptr
(
unsafe
.
Pointer
(
&
control
[
0
]
))
msg
.
Controllen
=
uint
ptr
(
len
(
control
)
*
4
)
_
,
err
=
Recvmsg
(
local
.
File
()
.
Fd
(),
&
msg
,
0
)
fmt
.
Printf
(
"getFuseConn: 100
\n
"
)
...
...
fuse/fuse_test.go
View file @
aab0374f
...
...
@@ -20,11 +20,11 @@ func TestMount(t *testing.T) {
defer
os
.
Remove
(
tempMountDir
)
m
,
err
:=
Mount
(
tempMountDir
,
fs
)
if
err
!=
nil
{
t
.
Fatal
(
"Can't mount a dir, err: %v"
,
err
)
t
.
Fatal
f
(
"Can't mount a dir, err: %v"
,
err
)
}
err
=
m
.
Unmount
()
if
err
!=
nil
{
t
.
Fatal
(
"Can't unmount a dir, err: %v"
,
err
)
t
.
Fatal
f
(
"Can't unmount a dir, err: %v"
,
err
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment