summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Gonzalez <rymg19@gmail.com>2017-08-03 14:06:05 -0500
committerOri Bernstein <ori@markovcorp.com>2017-08-03 14:26:24 -0700
commitfd6413695a72cde96cbf0644083e06f65ecdec9f (patch)
tree4e6dc3571090747eb87f78910531c827b1785dca
parent4e4f36fcf5177b0c51c4bcb5a203c5f86edf6e00 (diff)
downloadmc-fd6413695a72cde96cbf0644083e06f65ecdec9f.tar.gz
Add readlink syscall
-rw-r--r--lib/sys/sys+linux-x64.myr2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sys/sys+linux-x64.myr b/lib/sys/sys+linux-x64.myr
index c01eb6a..1f59810 100644
--- a/lib/sys/sys+linux-x64.myr
+++ b/lib/sys/sys+linux-x64.myr
@@ -807,6 +807,7 @@ pkg sys =
const rename : (from : byte[:], to : byte[:] -> int64)
const creat : (path:byte[:], mode:int64 -> fd)
const unlink : (path:byte[:] -> int)
+ const readlink : (path:byte[:], buf:byte[:] -> int64)
const read : (fd:fd, buf:byte[:] -> size)
const pread : (fd:fd, buf:byte[:], off : off -> size)
const write : (fd:fd, buf:byte[:] -> size)
@@ -947,6 +948,7 @@ const close = {fd; -> syscall(Sysclose, a(fd))}
const creat = {path, mode; -> (syscall(Syscreat, cstring(path), a(mode)) : fd)}
const rename = {from, to; -> syscall(Sysrename, cstring(from), cstring(to))}
const unlink = {path; -> (syscall(Sysunlink, cstring(path)) : int)}
+const readlink = {path, buf; -> syscall(Sysreadlink, cstring(path), (buf : byte#), a(buf.len))}
const read = {fd, buf; -> (syscall(Sysread, a(fd), (buf : byte#), a(buf.len)) : size)}
const pread = {fd, buf, off; -> (syscall(Syspread64, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
const write = {fd, buf; -> (syscall(Syswrite, a(fd), (buf : byte#), a(buf.len)) : size)}