patch-2.1.23 linux/net/netlink.c
Next file: linux/net/netrom/af_netrom.c
Previous file: linux/net/netbeui/netbeui.c
Back to the patch index
Back to the overall index
- Lines: 46
- Date:
Sat Jan 25 23:46:14 1997
- Orig file:
v2.1.22/linux/net/netlink.c
- Orig date:
Thu Dec 12 19:37:31 1996
diff -u --recursive --new-file v2.1.22/linux/net/netlink.c linux/net/netlink.c
@@ -26,6 +26,7 @@
#include <net/netlink.h>
+#include <asm/poll.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -63,19 +64,16 @@
return -EINVAL;
}
-static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
+static unsigned int netlink_poll(struct file *file, poll_table * wait)
{
- unsigned int minor = MINOR(inode->i_rdev);
- switch (sel_type) {
- case SEL_IN:
- if (skb_peek(&skb_queue_rd[minor])!=NULL)
- return 1;
- select_wait(&read_space_wait[minor], wait);
- break;
- case SEL_OUT:
- return 1;
- }
- return 0;
+ unsigned int mask;
+ unsigned int minor = MINOR(file->f_inode->i_rdev);
+
+ poll_wait(&read_space_wait[minor], wait);
+ mask = POLLOUT | POLLWRNORM;
+ if (skb_peek(&skb_queue_rd[minor]))
+ mask |= POLLIN | POLLRDNORM;
+ return mask;
}
/*
@@ -183,7 +181,7 @@
netlink_read,
netlink_write,
NULL, /* netlink_readdir */
- netlink_select,
+ netlink_poll,
netlink_ioctl,
NULL, /* netlink_mmap */
netlink_open,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov