summaryrefslogtreecommitdiff
path: root/lib/sys/sys+openbsd-x64.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-16 00:34:44 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-16 00:34:44 -0800
commitb623656b7898648e82dcc0adc5c4d03a5ba9b5da (patch)
treec01b67dc1d3a205e5b376a9e136b36f018ee45de /lib/sys/sys+openbsd-x64.myr
parentbf2829b82ba77f1f9fd5586e4216995366cf7aed (diff)
downloadmc-b623656b7898648e82dcc0adc5c4d03a5ba9b5da.tar.gz
Bulk of porting to NetBSD.
This wasn't so bad. Missing: - libthread - auditing all libsys struct types.
Diffstat (limited to 'lib/sys/sys+openbsd-x64.myr')
-rw-r--r--lib/sys/sys+openbsd-x64.myr5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index a0c46fd..466988b 100644
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -548,7 +548,9 @@ pkg sys =
const creat : (path:byte[:], mode:int64 -> fd)
const unlink : (path:byte[:] -> int)
const read : (fd:fd, buf:byte[:] -> size)
+ const readv : (fd:fd, iov:byte[:][:] -> size)
const write : (fd:fd, buf:byte[:] -> size)
+ const writev : (fd:fd, iov : byte[:][:] -> size)
const lseek : (fd:fd, off : off, whence : whence -> int64)
const stat : (path:byte[:], sb:statbuf# -> int64)
const lstat : (path:byte[:], sb:statbuf# -> int64)
@@ -558,6 +560,7 @@ pkg sys =
const getdents : (fd : fd, buf : byte[:] -> int64)
const chdir : (p : byte[:] -> int64)
const __getcwd : (buf : byte[:] -> int64)
+ const poll : (pfd : pollfd[:], tm : int -> int)
/* signals */
const sigaction : (sig : signo, act : sigaction#, oact : sigaction# -> int)
@@ -671,7 +674,9 @@ const close = {fd; -> syscall(Sysclose, a(fd))}
const creat = {path, mode; -> (openmode(path, Ocreat | Otrunc | Owronly, mode) : fd)}
const unlink = {path; -> (syscall(Sysunlink, cstring(path)) : int)}
const read = {fd, buf; -> (syscall(Sysread, a(fd), (buf : byte#), a(buf.len)) : size)}
+const readv = {fd, vec; -> (syscall(Sysreadv, a(fd), (vec : byte[:]#), a(vec.len)) : size)}
const write = {fd, buf; -> (syscall(Syswrite, a(fd), (buf : byte#), a(buf.len)) : size)}
+const writev = {fd, vec; -> (syscall(Syswritev, a(fd), (vec : byte[:]#), a(vec.len)) : size)}
const lseek = {fd, off, whence; -> syscall(Syslseek, a(fd), a(off), a(whence))}
const stat = {path, sb; -> syscall(Sysstat, cstring(path), a(sb))}
const lstat = {path, sb; -> syscall(Syslstat, cstring(path), a(sb))}