diff options
Diffstat (limited to 'lib/std/syswrap-ss+linux.myr')
-rw-r--r-- | lib/std/syswrap-ss+linux.myr | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/std/syswrap-ss+linux.myr b/lib/std/syswrap-ss+linux.myr new file mode 100644 index 0000000..1982e54 --- /dev/null +++ b/lib/std/syswrap-ss+linux.myr @@ -0,0 +1,22 @@ +use sys +use "errno.use" + +pkg std = + const exit : (status:int -> void) + pkglocal const bgetcwd : (buf : byte[:] -> errno) +;; + +const exit = {status; sys.exit_group(status)} +const bgetcwd = {buf; + var err + err = sys.getcwd(buf) castto(errno) + /* + if we got a length back, it includes + the nul byte. chop that off. + */ + if err > 0 + -> err - 1 + else + -> err + ;; +} |