Does what it says on the tin :-)
Fixes issue #20 for me and makes Mirage's non-blocking console output work.
diff --git a/sys/rump/librump/rumpkern/cons.c b/sys/rump/librump/rumpkern/cons.c
index f55a02b..cdf0fd5 100644
--- a/sys/rump/librump/rumpkern/cons.c
+++ b/sys/rump/librump/rumpkern/cons.c
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.4 2014/08/25 14:58:48
pooka Exp $");
#include <sys/ioctl.h>
#include <sys/kernel.h>
#include <sys/kmem.h>
+#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/termios.h>
@@ -56,13 +57,14 @@ static int rumpcons_write(struct file *, off_t *, struct
uio *,
kauth_cred_t, int);
static int rumpcons_ioctl(struct file *, u_long, void *);
static int rumpcons_stat(struct file *, struct stat *);
+static int rumpcons_poll(struct file *, int events);
static const struct fileops rumpcons_fileops = {
.fo_read = (void *)nullop,
.fo_write = rumpcons_write,
.fo_ioctl = rumpcons_ioctl,
.fo_fcntl = fnullop_fcntl,
- .fo_poll = fnullop_poll,
+ .fo_poll = rumpcons_poll,
.fo_stat = rumpcons_stat,
.fo_close = (void *)nullop,
.fo_kqfilter = fnullop_kqfilter,
@@ -142,3 +144,14 @@ rumpcons_stat(struct file *fp, struct stat *sb)
return 0;
}
+
+static int
+rumpcons_poll(struct file *fp, int events)
+{
+ int revents = 0;
+
+ if (events & (POLLOUT | POLLWRNORM))
+ revents |= POLLOUT | POLLWRNORM;
+
+ return revents;
+}