ref: 28ec6a3f0d0cc0e248ce54a65d92bddc8b125363
parent: 586fecf9ce10a7d9cdea222275916574355269fd
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Nov 24 12:35:49 EST 2012
Fix compilation of libstd on osx.
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -423,8 +423,8 @@
const open : (path:byte[:], opts:fdopt, mode:int64 -> int64)
const close : (fd:int64 -> int64)
const creat : (path:byte[:], mode:int64 -> int64)
- const read : (fd:int64, buf:byte[:] -> int64)
- const write : (fd:int64, buf:byte[:] -> int64)
+ const read : (fd:int64, buf:byte[:] -> size)
+ const write : (fd:int64, buf:byte[:] -> size)
const lseek : (fd:int64, off:uint64, whence:int64 -> int64)
const fstat : (fd:int64, sb:statbuf* -> int64)
const munmap : (addr:byte*, len:size -> int64)
@@ -431,15 +431,15 @@
const mmap : (addr:byte*, len:size, prot:mprot, flags:mopt, fd:int64, off:off -> byte*)
;;
-const exit = {status; syscall(Sysexit, 1);}-const getpid = {; -> syscall(Sysgetpid, 1);}-const kill = {pid, sig; -> syscall(Syskill, pid, sig);}-const open = {path, opts, mode; -> syscall(Sysopen, cstring(path), opts, mode);}-const close = {fd; -> syscall(Sysclose, fd);}-const creat = {path, mode; -> open(path, Ocreat | Otrunc | Owronly, mode);}-const read = {fd, buf; -> syscall(Sysread, fd, buf castto(char*), buf.len);}-const write = {fd, buf; -> syscall(Syswrite, fd, buf castto(char*), buf.len castto(size));}-const lseek = {fd, off, whence; -> syscall(Syslseek, fd, off, whence);}-const fstat = {fd, sb; -> syscall(Sysfstat, fd, sb);}-const munmap = {addr, len; -> syscall(Sysmunmap, addr, len);}-const mmap = {addr, len, prot, flags, fd, off; -> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte*);}+const exit = {status; syscall(Sysexit, 1)}+const getpid = {; -> syscall(Sysgetpid, 1)}+const kill = {pid, sig; -> syscall(Syskill, pid, sig)}+const open = {path, opts, mode; -> syscall(Sysopen, cstring(path), opts, mode)}+const close = {fd; -> syscall(Sysclose, fd)}+const creat = {path, mode; -> open(path, Ocreat | Otrunc | Owronly, mode)}+const read = {fd, buf; -> syscall(Sysread, fd, buf castto(char*), buf.len) castto(size)}+const write = {fd, buf; -> syscall(Syswrite, fd, buf castto(char*), buf.len castto(size)) castto(size)}+const lseek = {fd, off, whence; -> syscall(Syslseek, fd, off, whence)}+const fstat = {fd, sb; -> syscall(Sysfstat, fd, sb)}+const munmap = {addr, len; -> syscall(Sysmunmap, addr, len)}+const mmap = {addr, len, prot, flags, fd, off; -> syscall(Sysmmap, addr, len, prot, flags, fd, off) castto(byte*)}--
⑨