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
de161fea
Commit
de161fea
authored
Mar 17, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup code for writev.
parent
9d593fde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
fuse/misc.go
fuse/misc.go
+17
-15
No files found.
fuse/misc.go
View file @
de161fea
...
...
@@ -243,33 +243,35 @@ func CopyFileInfo(fi *os.FileInfo, attr *Attr) {
func
writev
(
fd
int
,
iovecs
*
syscall
.
Iovec
,
cnt
int
)
(
n
int
,
errno
int
)
{
n1
,
_
,
e1
:=
syscall
.
Syscall
(
syscall
.
SYS_WRITEV
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
iovecs
)),
uintptr
(
cnt
))
n
=
int
(
n1
)
errno
=
int
(
e1
)
return
n1
,
_
,
e1
:=
syscall
.
Syscall
(
syscall
.
SYS_WRITEV
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
iovecs
)),
uintptr
(
cnt
)
)
return
int
(
n1
),
int
(
e1
)
}
func
Writev
(
fd
int
,
packet
[][]
byte
)
(
n
int
,
err
os
.
Error
)
{
if
len
(
packet
)
==
0
{
return
}
iovecs
:=
make
([]
syscall
.
Iovec
,
len
(
packet
))
iovecs
:=
make
([]
syscall
.
Iovec
,
0
,
len
(
packet
))
j
:=
0
for
i
,
v
:=
range
packet
{
for
_
,
v
:=
range
packet
{
if
v
==
nil
||
len
(
v
)
==
0
{
continue
}
iovecs
[
j
]
.
Base
=
(
*
byte
)(
unsafe
.
Pointer
(
&
packet
[
i
][
0
]))
iovecs
[
j
]
.
SetLen
(
len
(
packet
[
i
]))
j
++
vec
:=
syscall
.
Iovec
{
Base
:
&
v
[
0
],
}
vec
.
SetLen
(
len
(
v
))
iovecs
=
append
(
iovecs
,
vec
)
}
if
len
(
iovecs
)
==
0
{
return
0
,
nil
}
n
,
errno
:=
writev
(
fd
,
(
*
syscall
.
Iovec
)(
unsafe
.
Pointer
(
&
iovecs
[
0
])),
j
)
n
,
errno
:=
writev
(
fd
,
&
iovecs
[
0
],
len
(
iovecs
))
if
errno
!=
0
{
err
=
os
.
NewSyscallError
(
"writev"
,
errno
)
}
return
return
n
,
err
}
func
CountCpus
()
int
{
...
...
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