summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-09-25 13:42:50 -0400
committerOri Bernstein <ori@eigenstate.org>2014-09-25 13:48:22 -0400
commit428f4464c3a58ebc5779bb974bd2e789ded86fd6 (patch)
treee752c685303ffb6889f2f8e9f5fd1dcfaeeec839 /libstd
parent0a7a934f544bdd4ad8784fe87d3e87d0e154ff59 (diff)
downloadmc-428f4464c3a58ebc5779bb974bd2e789ded86fd6.tar.gz
Add chdir() syscall.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/sys-linux.myr2
-rw-r--r--libstd/sys-osx.myr2
2 files changed, 4 insertions, 0 deletions
diff --git a/libstd/sys-linux.myr b/libstd/sys-linux.myr
index edee176..cc3c9fd 100644
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -567,6 +567,7 @@ pkg std =
const mkdir : (path : byte[:], mode : int64 -> int64)
const ioctl : (fd:fd, req : int64, args:... -> int64)
const getdents64 : (fd:fd, buf : byte[:] -> int64)
+ const chdir : (p : byte[:] -> int64)
/* fd stuff */
const pipe : (fds : fd[:] -> int64)
@@ -688,6 +689,7 @@ const ioctl = {fd, req, args
-> syscall(Sysioctl, a(fd), a(req), a(arg)) castto(int64)
}
const getdents64 = {fd, buf; -> syscall(Sysgetdents64, a(fd), buf castto(byte#), a(buf.len))}
+const chdir = {dir; -> syscall(Syschdir, dir)}
/* file stuff */
const pipe = {fds; -> syscall(Syspipe, fds castto(fd#))}
diff --git a/libstd/sys-osx.myr b/libstd/sys-osx.myr
index d990c63..0bb4cbb 100644
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -577,6 +577,7 @@ pkg std =
const mkdir : (path : byte[:], mode : int64 -> int64)
const ioctl : (fd:fd, req : int64, args:... -> int64)
const getdirentries64 : (fd : fd, buf : byte[:], basep : int64# -> int64)
+ const chdir : (p : byte[:] -> int64)
/* fd stuff */
const pipe : (fd : fd[:] -> int64)
@@ -714,6 +715,7 @@ const ioctl = {fd, req, args
-> syscall(Sysioctl, a(fd), a(req), a(arg)) castto(int64)
}
const getdirentries64 = {fd, buf, basep; -> syscall(Sysgetdirentries64, a(fd), buf castto(byte#), a(buf.len), a(basep))}
+const chdir = {dir; -> syscall(Syschdir, dir)}
/* fd stuff */
const pipe = {fd; -> __osx_pipe(fd castto(fd#))}