Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern Implement fo_poll so that rump_sys...



details:   https://anonhg.NetBSD.org/src/rev/cc7abaec4ac8
branches:  trunk
changeset: 808610:cc7abaec4ac8
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue May 26 15:29:39 2015 +0000

description:
Implement fo_poll so that rump_sys_poll(stdout) works
more or less as expected.

from Martin Lucina <martin%lucina.net@localhost> via rumpkernel-users

diffstat:

 sys/rump/librump/rumpkern/cons.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (57 lines):

diff -r 6a63678ca81c -r cc7abaec4ac8 sys/rump/librump/rumpkern/cons.c
--- a/sys/rump/librump/rumpkern/cons.c  Tue May 26 06:55:08 2015 +0000
+++ b/sys/rump/librump/rumpkern/cons.c  Tue May 26 15:29:39 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.c,v 1.4 2014/08/25 14:58:48 pooka Exp $   */
+/*     $NetBSD: cons.c,v 1.5 2015/05/26 15:29:39 pooka Exp $   */
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.4 2014/08/25 14:58:48 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.5 2015/05/26 15:29:39 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/file.h>
@@ -44,6 +44,7 @@
 #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 @@
                          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 @@
 
        return 0;
 }
+
+static int
+rumpcons_poll(struct file *fp, int events)
+{
+       int revents = 0;
+
+       if (events & (POLLOUT | POLLWRNORM))
+               revents |= events & (POLLOUT | POLLWRNORM);
+
+       return revents;
+}



Home | Main Index | Thread Index | Old Index