![]() |
| | #2 (permalink) |
| Gunzfactorian Guardian | Right!, good for you to want to know how to use polls instead of select, it's way much better. man poll, or man epoll in Linux 2.6 #include <linux/poll.h> int scmd_poll(struct file* filp , poll_table * pwait) int canwrite, canread; unsigned int mask=0; scmd_dev_t * dev; dev = (scmd_dev_t *) filp->private_data; poll_wait(filp,&dev->inq, pwait); poll_wait(filp,&dev->outq, pwait); canwrite = ((dev->rp + SCMD_SIZE - dev->wp ) % SCMD_SIZE) != 1; canread = (dev->rp != dev->wp); if (canread) mask |= POLLIN | POLLRDNORM; if (canwrite) mask |= POLLOUT | POLLWRNORM; return mask; } --------------- Just kidding, i have no idea how to make polls in vBulletin, is it even enabled? Cheers. Last edited by MajorMK; 04-10-2006 at 02:50 PM. Reason: Double post. Please use the edit feature. |
| | |
![]() |
| Thread Tools | |
| |