]> Cypherpunks repositories - gostls13.git/commitdiff
pull O_RDONLY etc. up to os library
authorRob Pike <r@golang.org>
Thu, 11 Sep 2008 22:09:10 +0000 (15:09 -0700)
committerRob Pike <r@golang.org>
Thu, 11 Sep 2008 22:09:10 +0000 (15:09 -0700)
R=rsc
DELTA=16  (14 added, 0 deleted, 2 changed)
OCL=15156
CL=15163

src/lib/os/os_file.go
src/syscall/file_amd64_darwin.go
src/syscall/file_amd64_linux.go

index 333c70c69f6eed474cdba30571158290b1c85f14..0867b60853259bfe62aaa17bec789787328a7389 100644 (file)
@@ -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)
index 95d3ce55d442c73faa67813f474f42fcb4a1faec..6bf60b9276d93d5997a1b120514cfca1d45529a6 100644 (file)
@@ -51,7 +51,7 @@ export type Stat struct {
        st_qspare[2]    int64;
 }
 
-const (
+export const (
        O_RDONLY = 0x0;
        O_WRONLY = 0x1;
        O_RDWR = 0x2;
index dc99d7de394cf991a96524d1ce16407d2281f485..1757bf7c7f5b2b10cd88aaede4bb7fa5f67a502a 100644 (file)
@@ -52,7 +52,7 @@ export type Stat struct {
        st_unused6      int64;
 }
 
-const (
+export const (
        O_RDONLY = 0x0;
        O_WRONLY = 0x1;
        O_RDWR = 0x2;