ref: 30234b14a10a94f21b6f84559fce135f43cb2e71
parent: 07c71bf1ffe122b10c171d151f36c03a0f73585a
author: Ori Bernstein <[email protected]>
date: Thu Oct 4 06:29:42 EDT 2012
Fix the temporary string allocation on OSX.
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -415,6 +415,7 @@
const Sysfileport_makefd : scno = 0x20001b1
extern const syscall : (sc:scno, args:... -> int64)
+ extern const cstring : (str : byte[:] -> byte*)
const exit : (status:int64 -> void)
const getpid : ( -> int64)
@@ -433,7 +434,7 @@
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 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);}