Sun Java Solaris Communities My SDN Account

Article

Using the devpoll (/dev/poll) Interface in the Solaris OS

 
By Shridhar Acharya, March 2002 (originally published on Access1)  
Introduction

The Solaris 7 11/99 Operating System introduced a new mechanism for polling file descriptors. The /dev/poll (devpoll) driver is a special pseudo driver that allows a process to monitor multiple sets of polled file descriptors. Access to the devpoll driver is provided through the open(2), write(2), and ioctl(2) system calls.

The devpoll driver returns the number of the polled file descriptors that have data in them. One can then read only those file descriptors using a pollfd type array. Thus, one does not have to continuously poll a large number of file descriptors, including those that may not have any data in them. This makes for a more efficient use of the system resources.

For more details, see the list of contents below.

Download the document as PDF.

Contents
  • Introduction
  • Description of the Test Case
    • The UDP Server Program (udpdevpoll.c)
    • The UDP Client Program (udpclnt.c)
    • The Argument File Generation Program (generate.c)
  • Source Code for the Programs
    • udpdevpoll.c
    • udpclnt.c
    • generate.c
  • Further References
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.

Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.