gtpc2mjh | C/C++ Language Support User's Guide |
This type of function is specified as part of the file system device driver interface. This function is called by the select function to direct the device driver to remove any pending wait_queue elements. Wait_queue elements are used during select function processing to determine if the open file descriptor is ready for reading, writing, or if any exception conditions are pending. The device driver is determined by the major and minor device type from the open file descriptor at open time. A file descriptor can be of any device type that is supported by the TPF system.
Format
typedef int TPF_FSDD_POLL_CLEAN(struct fd_entry *fd_ptr, TPF_FSDD_FILEDATA *fita_ptr);
typedef struct TPF_FSDD_FILEDATA { long filedata_length; void * filedata_state_ptr; } TPF_FSDD_FILEDATA;
The information needed by the device drivers is carried in this object.
Normal Return
One of the following values:
Error Return
A value of -1. The request to check the state of the open file descriptor could not be processed because of a possible permanent internal error. The device driver should set errno to an appropriate error code. Calling programs should examine this return environment variable for additional information.
Programming Considerations
The TPF_FSDD_POLL_CLEAN-type device driver function can be called any number of times for the same open file descriptor. The file descriptor entry must be open and accessible to be able to use this device driver function.
Examples
The following example is the poll cleanup device driver interface function for the null file (/dev/null).
#include <c$spif.h> /* Device driver interface */ /**********************************************************************/ /* The null_poll_clean() function is a NOP. */ /**********************************************************************/ int null_poll_clean(struct fd_entry *fd_ptr, TPF_FSDD_FILEDATA *filedata) { return 0; }
Related Information