Posted on 2005-05-14
Last Modified: 2012-05-05
sir ,
below i wrote some code related to poll implementation in linux device drivers found in oreilly publications "linux device drivers " book .
 unsigned int scull_p_poll(struct file *filp ,
                  poll_table *wait)
          int mask ;
  poll_wait(filp,&wait_queue1 ,wait);
  poll_wait(filp ,&wait_queue2 ,wait);

 if(readable) mask|=POLLIN | POLLRDNORM;
            mask|=POLLOUT | POLLWRNORM;

poll method is used to check whether a operation will succed before actually calling it .

So , what is the need for poll_wait() ? .
we have to check only condition for readability or writability and return corresponding mask .

Question by:karana
    1 Comment
    LVL 3

    Accepted Solution

    The short answer is that it's just necessary for the xxpoll() routine to add to one or more wait queues so that it can be awakened when I/O is ready. The kernel can't do this before calling xxpoll() because only the driver knows how to access the queues.

    It looks like you have an old edition of this book. The Third Edition, available freely online at:

    has a lot more detail on the subject.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now