[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

selnotify Kernel Service

Purpose

Wakes up processes waiting in a poll or select subroutine or in the fp_poll kernel service.

Syntax

#include <sys/types.h>
#include <sys/errno.h>


void selnotify ( id, subid, rtnevents)
int id;
int subid;
ushort rtnevents;

Parameters

id Indicates a primary resource identification value. This value along with the subidentifier (specified by the subid parameter) is used by the kernel to notify the appropriate processes of the occurrence of the indicated events. If the resource on which the event has occurred is a device driver, this parameter must be the device major/minor number (that is, a dev_t structure that has been cast to an int). The kernel has reserved values for the id parameter that do not conflict with possible device major or minor numbers for sockets, message queues, and named pipes.
subid Helps identify the resource on which the event has occurred for the kernel. For a multiplexed device driver, this is the number of the channel on which the requested events occurred. If the device driver is nonmultiplexed, the subid parameter must be set to 0.
rtnevents Consists of a set of bits indicating the requested events that have occurred on the specified device or channel. These flags have the same definition as the event flags that were provided by the events parameter on the unsatisfied call to the object's select routine.

Description

The selnotify kernel service should be used by device drivers that support select or poll operations. It is also used by the kernel to support select or poll requests to sockets, named pipes, and message queues.

The selnotify kernel service wakes up processes waiting on a select or poll subroutine. The processes to be awakened are those specifying the given device and one or more of the events that have occurred on the specified device. The select and poll subroutines allow a process to request information about one or more events on a particular device. If none of the requested events have yet happened, the process is put to sleep and re-awakened later when the events actually happen.

The selnotify service should be called whenever a previous call to the device driver's ddselect entry point returns and both of the following conditions apply:

The selnotify service can be called for other than these conditions but performs no operation.

Sequence of Events for Asynchronous Notification

The device driver must store information about the events requested while in the driver's ddselect routine under the following conditions:

The POLLSYNC flag, when not set, indicates that asynchronous notification is desired. In this case, the selnotify service should be called when one or more of the requested events later becomes true for that device and channel.

When the device driver finds that it can satisfy a select request, (perhaps due to new input data) and an unsatisfied request for that event is still pending, the selnotify service is called with the following items:

These parameters describe the device instance and requested events that have occurred on that device. The notifying device driver then resets its requested-events flags for the events that have occurred for that device and channel. The reset flags thus indicate that those events are no longer requested.

If the rtnevents parameter indicated by the call to the selnotify service is no longer being waited on, no processes are awakened.

Execution Environment

The selnotify kernel service can be called from either the process or interrupt environment.

Return Values

The selnotify service has no return values.

Implementation Specifics

The selnotify kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The ddselect device driver entry point.

The fp_poll kernel service, fp_select kernel service, selreg kernel service.

The poll subroutine, select subroutine.

Kernel Extension and Device Driver Management Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]