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
6eda76d6
Commit
6eda76d6
authored
Mar 24, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly null-terminate strings before calling Syscall.
parent
b3c60b74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
fuse/xattr.go
fuse/xattr.go
+6
-6
No files found.
fuse/xattr.go
View file @
6eda76d6
...
...
@@ -12,12 +12,12 @@ var _ = fmt.Print
// TODO - move this into the Go distribution.
func
getxattr
(
path
string
,
attr
string
,
dest
[]
byte
)
(
sz
int
,
errno
int
)
{
pathBs
:=
[]
byte
(
path
)
attrBs
:=
[]
byte
(
attr
)
pathBs
:=
syscall
.
StringBytePtr
(
path
)
attrBs
:=
syscall
.
StringBytePtr
(
attr
)
size
,
_
,
errNo
:=
syscall
.
Syscall6
(
syscall
.
SYS_GETXATTR
,
uintptr
(
unsafe
.
Pointer
(
&
pathBs
[
0
]
)),
uintptr
(
unsafe
.
Pointer
(
&
attrBs
[
0
]
)),
uintptr
(
unsafe
.
Pointer
(
pathBs
)),
uintptr
(
unsafe
.
Pointer
(
attrBs
)),
uintptr
(
unsafe
.
Pointer
(
&
dest
[
0
])),
uintptr
(
len
(
dest
)),
0
,
0
)
...
...
@@ -41,10 +41,10 @@ func GetXAttr(path string, attr string) (value []byte, errno int) {
}
func
listxattr
(
path
string
,
dest
[]
byte
)
(
sz
int
,
errno
int
)
{
pathbs
:=
[]
byte
(
path
)
pathbs
:=
syscall
.
StringBytePtr
(
path
)
size
,
_
,
errNo
:=
syscall
.
Syscall
(
syscall
.
SYS_LISTXATTR
,
uintptr
(
unsafe
.
Pointer
(
&
pathbs
[
0
]
)),
uintptr
(
unsafe
.
Pointer
(
pathbs
)),
uintptr
(
unsafe
.
Pointer
(
&
dest
[
0
])),
uintptr
(
len
(
dest
)))
...
...
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