Allows data to be sent using a file descriptor.
#include <sys/select.h>
int select (nfdsmsgs, readlist, writelist, exceptlist, 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.
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.
Each GDLC supports the select subroutine interface via its dlcselect entry point. This subroutine can be called from the process environment only.
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:
The select subroutine.
Select/Poll Logic for ddwrite and ddread Routines in AIX 5L Version 5.2 Technical Reference: Kernel and Subsystems Volume 1.
Generic Data Link Control (GDLC) Environment Overview in AIX 5L Version 5.2 Communications Programming Concepts.