'\" te
.\"  Copyright (c) 2003, Sun Microsystems, Inc.,  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LDI_POLL 9F "Jun 3, 2003"
.SH NAME
ldi_poll \- Poll a device
.SH SYNOPSIS
.LP
.nf
#include <sys/sunldi.h>



\fBint\fR \fBldi_poll\fR(\fBldi_handle_t\fR \fIlh\fR, \fBshort\fR \fIevents\fR, \fBint\fR \fIanyyet\fR, \fBshort *\fR\fIreventsp\fR,
     \fBstruct pollhead **\fR\fIphpp\fR);
.fi

.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIlh\fR \fR
.ad
.RS 13n
Layered handle.
.RE

.sp
.ne 2
.na
\fB\fIevents\fR \fR
.ad
.RS 13n
Potential events. Valid events are:
.sp
.ne 2
.na
\fBPOLLIN\fR
.ad
.RS 14n
Data other than high priority data may be read without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLOUT\fR
.ad
.RS 14n
Normal data may be written without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLPRI\fR
.ad
.RS 14n
High priority data may be received without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLHUP\fR
.ad
.RS 14n
Device hangup has occurred.
.RE

.sp
.ne 2
.na
\fBPOLLERR\fR
.ad
.RS 14n
An error has occurred on the device.
.RE

.sp
.ne 2
.na
\fBPOLLRDNORM\fR
.ad
.RS 14n
Normal data (priority band = 0) may be read without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLRDBAND\fR
.ad
.RS 14n
Data from a non-zero priority band may be read without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLWRNORM\fR
.ad
.RS 14n
Data other than high priority data may be read without blocking.
.RE

.sp
.ne 2
.na
\fBPOLLWRBAND\fR
.ad
.RS 14n
Priority data (priority band > 0) may be written.
.RE

.RE

.sp
.ne 2
.na
\fB\fIanyyet\fR\fR
.ad
.RS 13n
A flag that is non-zero if any other file descriptors                 in the
pollfd array have events pending. The \fBpoll\fR(2) system call takes a pointer
to an array of pollfd                 structures as one of its arguments. See
\fBpoll\fR(2) for more details.
.RE

.sp
.ne 2
.na
\fB\fIreventsp\fR \fR
.ad
.RS 13n
Pointer to a bitmask of the returned events satisfied.
.RE

.sp
.ne 2
.na
\fB\fIphpp\fR \fR
.ad
.RS 13n
Pointer to a pointer to a pollhead structure.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBldi_poll()\fR function passes a poll request to the device entry point
for the device specified by the layered handle. This operation is supported for
block, character, and streams devices.
.SH RETURN VALUES
.sp
.LP
The \fBldi_poll()\fR function returns \fB0\fR upon success. If a failure occurs
before the request is passed on to the device, possible return values are:
.sp
.ne 2
.na
\fBEINVAL\fR
.ad
.RS 11n
Invalid input parameters.
.RE

.sp
.ne 2
.na
\fBENOTSUP\fR
.ad
.RS 11n
Operation is not supported for this device.
.RE

.SH CONTEXT
.sp
.LP
These functions may be called from user or kernel context.