shithub: mc

Download patch

ref: 50b8f79715b5b681a115c6ded65b0c0dd42d388f
parent: a9b279f034a8bc642be35baabc603e055e979e6b
author: Ori Bernstein <[email protected]>
date: Tue Dec 17 18:52:23 EST 2013

Add mkdir() support.

--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -444,6 +444,7 @@
 	const write	: (fd:fd, buf:byte[:] -> size)
 	const lseek	: (fd:fd, off:uint64, whence:int64 -> int64)
 	const fstat	: (fd:fd, sb:statbuf# -> int64)
+	const mkdir	: (path : byte[:], mode : int64	-> int64)
 
 	/* networking */
 	const socket	: (dom : sockfam, stype : socktype, proto : sockproto	-> fd)
@@ -478,6 +479,7 @@
 const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(byte#), 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 mkdir	= {path, mode;		-> syscall(Sysmkdir, cstring(path), mode) castto(int64))
 
 /* networking */
 const socket	= {dom, stype, proto;	-> syscall(Syssocket, dom castto(int64), stype, proto) castto(fd)}
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -491,6 +491,7 @@
 	const write	: (fd:fd, buf:byte[:] -> size)
 	const lseek	: (fd:fd, off:uint64, whence:int64 -> int64)
 	const fstat	: (fd:fd, sb:statbuf# -> int64)
+	const mkdir	: (path : byte[:], mode : int64	-> int64)
 
 	/* networking */
 	const socket	: (dom : sockfam, stype : socktype, proto : sockproto	-> fd)
@@ -529,6 +530,7 @@
 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 mkdir	= {path, mode;		-> syscall(Sysmkdir, cstring(path), mode) castto(int64))
 
 /* networking */
 const socket	= {dom, stype, proto;	-> syscall(Syssocket, dom castto(int64), stype, proto) castto(fd) }