Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5ea7649b
Commit
5ea7649b
authored
Sep 11, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull O_RDONLY etc. up to os library
R=rsc DELTA=16 (14 added, 0 deleted, 2 changed) OCL=15156 CL=15163
parent
ccede3e8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
os_file.go
src/lib/os/os_file.go
+14
-0
file_amd64_darwin.go
src/syscall/file_amd64_darwin.go
+1
-1
file_amd64_linux.go
src/syscall/file_amd64_linux.go
+1
-1
No files found.
src/lib/os/os_file.go
View file @
5ea7649b
...
@@ -27,6 +27,20 @@ export var (
...
@@ -27,6 +27,20 @@ export var (
Stderr
=
NewFD
(
2
);
Stderr
=
NewFD
(
2
);
)
)
export
const
(
O_RDONLY
=
syscall
.
O_RDONLY
;
O_WRONLY
=
syscall
.
O_WRONLY
;
O_RDWR
=
syscall
.
O_RDWR
;
O_APPEND
=
syscall
.
O_APPEND
;
O_ASYNC
=
syscall
.
O_ASYNC
;
O_CREAT
=
syscall
.
O_CREAT
;
O_NOCTTY
=
syscall
.
O_NOCTTY
;
O_NONBLOCK
=
syscall
.
O_NONBLOCK
;
O_NDELAY
=
O_NONBLOCK
;
O_SYNC
=
syscall
.
O_SYNC
;
O_TRUNC
=
syscall
.
O_TRUNC
;
)
export
func
Open
(
name
string
,
mode
int64
,
flags
int64
)
(
fd
*
FD
,
err
*
Error
)
{
export
func
Open
(
name
string
,
mode
int64
,
flags
int64
)
(
fd
*
FD
,
err
*
Error
)
{
r
,
e
:=
syscall
.
open
(
name
,
mode
,
flags
);
r
,
e
:=
syscall
.
open
(
name
,
mode
,
flags
);
return
NewFD
(
r
),
ErrnoToError
(
e
)
return
NewFD
(
r
),
ErrnoToError
(
e
)
...
...
src/syscall/file_amd64_darwin.go
View file @
5ea7649b
...
@@ -51,7 +51,7 @@ export type Stat struct {
...
@@ -51,7 +51,7 @@ export type Stat struct {
st_qspare
[
2
]
int64
;
st_qspare
[
2
]
int64
;
}
}
const
(
export
const
(
O_RDONLY
=
0x0
;
O_RDONLY
=
0x0
;
O_WRONLY
=
0x1
;
O_WRONLY
=
0x1
;
O_RDWR
=
0x2
;
O_RDWR
=
0x2
;
...
...
src/syscall/file_amd64_linux.go
View file @
5ea7649b
...
@@ -52,7 +52,7 @@ export type Stat struct {
...
@@ -52,7 +52,7 @@ export type Stat struct {
st_unused6
int64
;
st_unused6
int64
;
}
}
const
(
export
const
(
O_RDONLY
=
0x0
;
O_RDONLY
=
0x0
;
O_WRONLY
=
0x1
;
O_WRONLY
=
0x1
;
O_RDWR
=
0x2
;
O_RDWR
=
0x2
;
...
...
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