Commit 5ea7649b authored by Rob Pike's avatar Rob Pike

pull O_RDONLY etc. up to os library

R=rsc
DELTA=16  (14 added, 0 deleted, 2 changed)
OCL=15156
CL=15163
parent ccede3e8
......@@ -27,6 +27,20 @@ export var (
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) {
r, e := syscall.open(name, mode, flags);
return NewFD(r), ErrnoToError(e)
......
......@@ -51,7 +51,7 @@ export type Stat struct {
st_qspare[2] int64;
}
const (
export const (
O_RDONLY = 0x0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
......
......@@ -52,7 +52,7 @@ export type Stat struct {
st_unused6 int64;
}
const (
export const (
O_RDONLY = 0x0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment