patch-pre2.0.11 linux/net/netlink.c

Next file: linux/net/netsyms.c
Previous file: linux/net/ipv4/tcp_timer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.10/linux/net/netlink.c linux/net/netlink.c
@@ -63,6 +63,21 @@
 	return -EINVAL;
 }
 
+static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_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;
+}
+
 /*
  *	Write a message to the kernel side of a communication link
  */
@@ -161,7 +176,7 @@
 	netlink_read,
 	netlink_write,
 	NULL,		/* netlink_readdir */
-	NULL,		/* netlink_select */
+	netlink_select,
 	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 with Sam's (original) version
of this