Allows data to be sent using a file descriptor.
#include <sys/select.h>
int select (nfdsmsgs, readlist, writelist, exceptlist, timeout) int nfdsmsgs; struct sellist *readlist, *writelist, *exceptlist; struct timeval *timeout;
The select subroutine checks the specified file descriptor and message queues to see if they are ready for reading (receiving) or writing (sending), or if they have an exception condition pending.
Note: Generic data link control (GDLC) does not support transmit for nonblocked notification in the full sense. If the writelist parameter is specified in the select call, GDLC always returns as if transmit is available. There is no checking to see if internal buffering is available or if internal control-block locks are free. These resources are much too dynamic, and tests for their availability can be done reasonably only at the time of use.
The readlist and exceptlist parameters are fully supported. Whenever the selection criteria specified by the SelType parameter is true, the file system returns a value that indicates the total number of file descriptors and message queues that satisfy the selection criteria. The fdsmask bit masks are modified so that bits set to a value of 1 indicate file descriptors that meet the criteria. The msgids arrays are altered so that message queue identifiers that do not meet the criteria are replaced with a value of -1. If the selection is not satisfied, the calling process is put to sleep waiting on a selwakeup subroutine at a later time.
Upon successful completion, the select subroutine returns a value that indicates the total number of file descriptors and message queues that satisfy the selection criteria. The return value is similar to the nfdsmsgs parameter in that the low-order 16 bits give the number of file descriptors. Also, the high-order 16 bits give the number of message queue identifiers. These values indicate the sum total that meet each of the read and exception criteria.
If the time limit specified by the timeout parameter expires, then the select subroutine returns a value of 0 (zero).
If an error occurs, a value of -1 is returned with one of the following error values available using the errno global variable, as defined in the /usr/include/sys/errno.h file:
Each GDLC supports the select subroutine interface via its dlcselect entry point. This subroutine can be called from the process environment only.
The select subroutine.
Select/Poll Logic for ddwrite and ddread Routines in AIX Version 4.3 Technical Reference: Kernel and Subsystems Volume 1.
Generic Data Link Control (GDLC) Environment Overview in AIX Version 4.3 Communications Programming Concepts.