Motorola MCP750 Specifications Page 164

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 163
D
evice Driver Programming
10-18
The Chpoll Routine 10
Specification
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/cred.h>
#include <sys/ddi.h>
int xxchpoll (dev, events, anyyet, reventsp, phpp)
dev_t dev;
int events;
void * anyyet;
int reventsp;
cred_t *phpp;
Return Values
0 if the poll is successful
A nonzero value if the poll fails. The number is returned to the user in
errno; it should be an error number as defined in <sys/errno.h>.
The device driver’s chpoll routine is called when a poll(2) system call is made on
the associated device. The poll entry point is optional. It is valid for character device driv-
ers only.
The dev argument specifies the device major and minor number.
The events argument specifies a bit mask that indicates the I/O event(s) for which the
specified device is being polled. One or more of the following bits might be set:
POLLIN Data can be read from the device
POLLOUT Data can be written to the device
The anyyet argument specifies a flag that indicates whether or not I/O events are pending
for other devices that were specified on the poll(2) system call.
The reventsp argument is a pointer to a bit mask that indicates which requested I/O events
have occurred on the specified device. If an error has occurred on the device, the appropri-
ate error bit is set. One or more of the following bits might be set:
POLLIN Data can be read from the device
POLLOUT Data can be written to the device
POLLERR An error has occurred on the device
The phpp argument points to a pointer to a pollhead structure. This structure is defined
in <sys/poll.h>. The pollhead structure is not used by the device driver; it is used
by the poll service to monitor the I/O events for which the device is being polled.
The driver allocates a pollhead structure for each minor number of the device. The
pollhead structure might be a part of a driver data structure that is associated with the
Page view 163
1 2 ... 159 160 161 162 163 164 165 166 167 168 169 ... 343 344

Comments to this Manuals

No comments