[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Add poll() support to xenbus device file.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 056e571ce462d44612f2300ff17f589b2e43368b # Parent cf89e8f0831b3a483c1b8c614d1b8eb02180548b Add poll() support to xenbus device file. From: Gerd Hoffmann Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> diff -r cf89e8f0831b -r 056e571ce462 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Mon Mar 20 08:56:54 2006 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Mon Mar 20 11:00:58 2006 @@ -36,6 +36,7 @@ #include <linux/notifier.h> #include <linux/wait.h> #include <linux/fs.h> +#include <linux/poll.h> #include "xenbus_comms.h" @@ -207,11 +208,22 @@ return 0; } +static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait) +{ + struct xenbus_dev_data *u = file->private_data; + + poll_wait(file, &u->read_waitq, wait); + if (u->read_cons != u->read_prod) + return POLLIN | POLLRDNORM; + return 0; +} + static struct file_operations xenbus_dev_file_ops = { .read = xenbus_dev_read, .write = xenbus_dev_write, .open = xenbus_dev_open, .release = xenbus_dev_release, + .poll = xenbus_dev_poll, }; static int __init _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |