shithub: mc

Download patch

ref: 6f5ac74ad23e4ad8288fef156385ea2586d2d8fb
parent: 841bbb2787781233f55833edada40e72bcf5530f
author: Ori Bernstein <[email protected]>
date: Fri Jun 20 13:39:49 EDT 2014

add lstat() syscall

--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -498,6 +498,7 @@
 	const write	: (fd:fd, buf:byte[:] -> int64)
 	const lseek	: (fd:fd, off:uint64, whence:int64 -> int64)
 	const stat	: (path:byte[:], sb:statbuf# -> int64)
+	const lstat	: (path:byte[:], sb:statbuf# -> int64)
 	const fstat	: (fd:fd, sb:statbuf# -> int64)
 	const mkdir	: (path : byte[:], mode : int64	-> int64)
 	const ioctl	: (fd:fd, req : int64, args:... -> int64)
@@ -586,8 +587,8 @@
 const openmode	= {path, opts, mode;	-> syscall(Sysopen, cstring(path), opts, mode) castto(fd)}
 const close	= {fd;			-> syscall(Sysclose, fd)}
 const creat	= {path, mode;		-> syscall(Syscreat, cstring(path), mode) castto(fd)}
-const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(byte#), buf.len castto(size)) castto(size)}
-const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(byte#), buf.len castto(size)) castto(size)}
+const read	= {fd, buf;		-> syscall(Sysread, fd, buf castto(byte#), buf.len castto(size))}
+const write	= {fd, buf;		-> syscall(Syswrite, fd, buf castto(byte#), buf.len castto(size))}
 const lseek	= {fd, off, whence;	-> syscall(Syslseek, fd, off, whence)}
 const stat	= {path, sb;		-> syscall(Sysstat, cstring(path), sb)}
 const fstat	= {fd, sb;		-> syscall(Sysfstat, fd, sb)}