Krishna Logo
qa training in canada now
Divied
Call: Anusha @ 1 (877) 864-8462

 

Latest News
Home Navigation Divied
INTERVIEW Navigation Divied UNIX INTERVIEW QUESTIONS Navigation Divied How do I use poll ()?
How Do I Use Poll ()?
How do I use poll ()?

Ans: Poll() in UNIX is used for to wait for some event on a file descriptor. When poll() is used, the user must allocate an array of pollfd structures, and pass the number of entries in this array.
int poll(struct pollfd *ufds, unsigned int nfds, int timeout)
The parameter fd is a file descriptor to open the file while timeout is in milliseconds. If the timeout value is negative, it means negative timeout. The structure if the is as below:
struct pollfd {
        int fd; /* file descriptor */
        short events; /* requested events */
        short revents; /* returned events */
};


Shadow Bottom
 
 
© 2005 -