Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
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
Kirill Smelkov
go
Commits
f960840a
Commit
f960840a
authored
Oct 09, 2008
by
Cary Hull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding Mkdir.
R=rsc APPROVED=rsc DELTA=21 (21 added, 0 deleted, 0 changed) OCL=16794 CL=16803
parent
aed247fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
src/lib/os/os_file.go
src/lib/os/os_file.go
+5
-0
src/lib/syscall/file_darwin.go
src/lib/syscall/file_darwin.go
+8
-0
src/lib/syscall/file_linux.go
src/lib/syscall/file_linux.go
+8
-0
No files found.
src/lib/os/os_file.go
View file @
f960840a
...
...
@@ -91,3 +91,8 @@ export func Pipe() (fd1 *FD, fd2 *FD, err *Error) {
}
return
NewFD
(
p
[
0
]),
NewFD
(
p
[
1
]),
nil
}
export
func
Mkdir
(
name
string
,
perm
int
)
*
Error
{
r
,
e
:=
syscall
.
mkdir
(
name
,
int64
(
perm
));
return
ErrnoToError
(
e
)
}
src/lib/syscall/file_darwin.go
View file @
f960840a
...
...
@@ -86,3 +86,11 @@ export func fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
return
r1
,
err
}
export
func
mkdir
(
name
string
,
perm
int64
)
(
ret
int64
,
errno
int64
)
{
var
namebuf
[
NameBufsize
]
byte
;
if
!
StringToBytes
(
&
namebuf
,
name
)
{
return
-
1
,
ENAMETOOLONG
}
r1
,
r2
,
err
:=
Syscall
(
SYS_MKDIR
,
BytePtr
(
&
namebuf
[
0
]),
perm
,
0
);
return
r1
,
err
;
}
src/lib/syscall/file_linux.go
View file @
f960840a
...
...
@@ -87,3 +87,11 @@ export func fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
return
r1
,
err
}
export
func
mkdir
(
name
string
,
perm
int64
)
(
ret
int64
,
errno
int64
)
{
var
namebuf
[
NameBufsize
]
byte
;
if
!
StringToBytes
(
&
namebuf
,
name
)
{
return
-
1
,
ENAMETOOLONG
}
r1
,
r2
,
err
:=
Syscall
(
SYS_MKDIR
,
BytePtr
(
&
namebuf
[
0
]),
perm
,
0
);
return
r1
,
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