mirror of
https://github.com/golang/go
synced 2024-11-19 00:54:42 -07:00
pull O_RDONLY etc. up to os library
R=rsc DELTA=16 (14 added, 0 deleted, 2 changed) OCL=15156 CL=15163
This commit is contained in:
parent
ccede3e872
commit
5ea7649b43
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user