Selects for asynchronous criteria from generic data link control (GDLC), such as receive data completion and exception conditions.
#include <sys/device.h> #include <sys/poll.h> #include <sys/gdlextcb.h>
int dlcselect (devno, events, reventp, chan)
The dlcselect entry point is called when a user application program invokes a select or poll subroutine. This allows the user to select receive data or exception conditions. The POLLOUT write-availability criteria is not supported. If no results are available at the time of a select subroutine, the user process is put to sleep until an event occurs.
If one or more events specified in the events parameter are true, the dlcselect routine updates the reventp (returned events) parameter (passed by reference) by setting the corresponding event bits that indicate which events are currently true.
If none of the requested events are true, the dlcselect routine sets the returned events parameter to a value of 0 (passed by reference using the reventp parameter) and checks the POLLSYNC flag in the events parameter. If this flag is true, the routine returns because the event request was a synchronous request. If the POLLSYNC flag is false, an internal flag is set for each event requested in the events parameter.
When one or more of the requested events become true, GDLC issues the selnotify kernel service to notify the kernel that a requested event or events have become true. The internal flag indicating that the event was requested is then reset to prevent renotification of the event.
If the port in use is in a closed state, implying that the requested event or events can never be satisfied, GDLC sets the returned events flags to a value of 1 for each event that can never be satisfied. This is done so that the select or poll subroutine does not wait indefinitely.
Kernel users do not call an fp_select kernel service since their receive data and exception notification functions are called directly by GDLC. "open Subroutine Extended Parameters for DLC" details how these function handlers are specified.
Each GDLC supports the dlcselect entry point as its switch table entry for the select or poll subroutines. The file system calls this entry point from the process environment only.
The following return values are defined in the /usr/include/sys/errno.h file:
The select subroutine, poll subroutine.
The ddselect device entry point, dlcmpx entry point.
The fp_select kernel service.
open Subroutine Extended Parameters for DLC.
Generic Data Link Control (GDLC) Environment Overview in AIX 5L Version 5.2 Communications Programming Concepts.