summaryrefslogtreecommitdiff
path: root/lib/sys/sys+openbsd-x64.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-03-06 13:08:47 +1300
committerOri Bernstein <ori@eigenstate.org>2017-03-06 13:08:47 +1300
commit407437ff53418d0e1328b787d79e4155818ff6c1 (patch)
treea825a81008b0677ee2fdbac5c84eb118587c1075 /lib/sys/sys+openbsd-x64.myr
parentb3d835e235336f8c0e1979fe009eefb24117a169 (diff)
downloadmc-407437ff53418d0e1328b787d79e4155818ff6c1.tar.gz
Add missing `poll` on OpenBSD
Diffstat (limited to 'lib/sys/sys+openbsd-x64.myr')
-rw-r--r--lib/sys/sys+openbsd-x64.myr9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index 0f3cf02..6e8f41f 100644
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -17,6 +17,7 @@ pkg sys =
type fcntlcmd = int64
type signo = int32
type sigflags = int32
+ type sigset = uint32
type clock = union
`Clockrealtime
@@ -43,7 +44,12 @@ pkg sys =
usec : uint64
;;
- type sigset = uint32
+
+ type pollfd = struct
+ fd : fd
+ events : uint16
+ revents : uint16
+ ;;
type sigaction = struct
handler : byte# /* code pointer */
@@ -696,6 +702,7 @@ const pipe = {fds; -> syscall(Syspipe, fds)}
const dup = {fd; -> (syscall(Sysdup, a(fd)) : fd)}
const dup2 = {src, dst; -> (syscall(Sysdup2, a(src), a(dst)) : fd)}
const fcntl = {fd, cmd, args; -> syscall(Sysfcntl, a(fd), a(cmd), a(args))}
+const poll = {pfd, tm; -> (syscall(Syspoll, (pfd : byte#), a(pfd.len), a(tm)) : int)}
/* networking */
const socket = {dom, stype, proto; -> (syscall(Syssocket, a(dom), a(stype), a(proto)) : fd)}