ref: 407437ff53418d0e1328b787d79e4155818ff6c1
parent: b3d835e235336f8c0e1979fe009eefb24117a169
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Mar 6 08:08:47 EST 2017
Add missing `poll` on OpenBSD
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -17,6 +17,7 @@
type fcntlcmd = int64
type signo = int32
type sigflags = int32
+ type sigset = uint32
type clock = union
`Clockrealtime
@@ -43,8 +44,13 @@
usec : uint64
;;
- type sigset = uint32
+ type pollfd = struct
+ fd : fd
+ events : uint16
+ revents : uint16
+ ;;
+
type sigaction = struct
handler : byte# /* code pointer */
mask : sigset
@@ -696,6 +702,7 @@
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)}