> FD_ZERO(&sel); > FD_SET(handle, &sel); > ret = select(1, &sel, NULL, NULL, NULL); I think, it should be ret = select(handle+1, &sel, NULL, NULL, NULL); Otherwise your descriptor (handle) will not be polled on. Regards Mohanlal ----- Original Message ----- From: "Thorsten Kruse" <thokruse@xxxxxx> To: <kernelnewbies@xxxxxxxxxxxx> Sent: Wednesday, September 29, 2004 3:23 PM Subject: Problem with select > Hi! > > Currently I'm writing a char-driver for a serial multiportcard within > my degree dissertation. The only thing that doesn´t work is the > poll-routine. I have no idea what´s going wrong, I hope anyone can > help me. > The Problem is that the kernel never executes my poll-routine. This > routine is registered in the struct file_operations in my driver. The > poll-Routine looks like this: > > static unsigned int addi_poll(struct file *filp, poll_table *wait) > { > unsigned int mask = 0; > addi_module *module_info; > > module_info = (addi_module *) filp->private_data; > printk(KERN_INFO "Select\n"); > /*module_info->readq is the waitqueue*/ > poll_wait(filp, &module_info->readq, wait); > mask |= (POLLIN | POLLRDNORM); > > return(mask); > } > > Every time data is available my isr runs the following codeline: > > wake_up_interruptible(&module_info->readq); > > The source of my application contains the following lines: > ... > int handle; > fd_set sel; > > handle = open("/dev/ttySA0", O_RDWR | O_NONBLOCK); > if(handle < 0) > { > printf("Can`t find device\n"); > return(1); > } > FD_ZERO(&sel); > FD_SET(handle, &sel); > ret = select(1, &sel, NULL, NULL, NULL); > ... > > When I´m running the application it will never leave the select, > although data is incoming and wake_up_interruptible executes. Also the > output of printk is never printed out, so it seems that my routine is > never entered. > > Can anybody tell me what´s going wrong with that? For any hints I > would be very thankful. > > > Best regards > Thorsten Kruse > > > -- > GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail > +++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++ > > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/