diff options
author | Rob Pike <r@golang.org> | 2009-02-08 10:18:50 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-02-08 10:18:50 -0800 |
commit | 09c50da40220227bd34dcc9cb28100434305174f (patch) | |
tree | b4c649682549e6ef2355f4b82bbb3e326e229925 /src/lib/syscall/file_darwin.go | |
parent | 0eb337046a6602996dbc169ff12f4d4fb81fded1 (diff) | |
download | golang-09c50da40220227bd34dcc9cb28100434305174f.tar.gz |
First pass at reading directories.
Syscall support.
Readdirnames returns array of strings of contents of directory.
R=rsc
DELTA=216 (201 added, 0 deleted, 15 changed)
OCL=24642
CL=24655
Diffstat (limited to 'src/lib/syscall/file_darwin.go')
-rw-r--r-- | src/lib/syscall/file_darwin.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/syscall/file_darwin.go b/src/lib/syscall/file_darwin.go index c7087c036..5d128f743 100644 --- a/src/lib/syscall/file_darwin.go +++ b/src/lib/syscall/file_darwin.go @@ -40,6 +40,11 @@ func Write(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) { return r1, err; } +func Seek(fd int64, offset int64, whence int64) (ret int64, errno int64) { + r1, r2, err := Syscall(SYS_LSEEK, fd, offset, whence); + return r1, err; +} + func Pipe(fds *[2]int64) (ret int64, errno int64) { r1, r2, err := Syscall(SYS_PIPE, 0, 0, 0); if r1 < 0 { @@ -89,3 +94,7 @@ func Dup2(fd1, fd2 int64) (ret int64, errno int64) { return r1, err; } +func Getdirentries(fd int64, buf *byte, nbytes int64, basep *int64) (ret int64, errno int64) { + r1, r2, err := Syscall6(SYS_GETDIRENTRIES64, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes, int64(uintptr(unsafe.Pointer(basep))), 0, 0); + return r1, err; +} |