.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "IEEE1284_GET_IRQ_FD" 3 "" "" ""
.SH NAME
ieee1284_get_irq_fd, ieee1284_clear_irq \- interrupt notification
.SH "SYNOPSIS"
.ad l
.hy 0

#include <ieee1284\&.h>
.sp
.HP 25
int\ \fBieee1284_get_irq_fd\fR\ (struct\ parport\ *\fIport\fR);
.HP 24
int\ \fBieee1284_clear_irq\fR\ (struct\ parport\ *\fIport\fR,
	\ \ \ \ \ unsigned\ int\ *\fIcount\fR);
.ad
.hy

.SH "DESCRIPTION"

.PP
If the \fIport\fR has a configured interrupt line and the port type supports interrupt notification, it is possible to obtain a file descriptor that may be used for \fBselect\fR(2) or \fBpoll\fR(2)\&. Any event (readable, writable or exception) means that an interrupt has been triggered\&. No operations other than \fBselect\fR or \fBpoll\fR may be performed on the file descriptor\&.

.PP
The port must be open in order to call \fBieee1284_get_irq_fd\fR, and must be claimed when using \fBselect\fR or \fBpoll\fR\&.

.PP
The caller must not close the file descriptor, and may not use it at all when the port is not claimed\&.

.PP
When an interrupt has been detected, the caller must call \fBieee1284_clear_irq\fR to clear the interrupt condition, at which point the number of interrupts raised can be obtained by supplying a non\-\fBNULL\fR  \fIcount\fR\&.

.SH "RETURN VALUE"

.PP
For \fBieee1284_get_irq_fd\fR: If the return value is negative then it is an error code listed below\&. Otherwise it is a valid file descriptor\&. 

.TP
\fBE1284_NOTAVAIL\fR
No such file descriptor is available\&.

.TP
\fBE1284_INVALIDPORT\fR
The \fIport\fR parameter is invalid (for instance, perhaps the \fIport\fR is not open)\&.


.PP
For \fBieee1284_clear_irq\fR: 

.TP
\fBE1284_OK\fR
The interrupt has been cleared\&. If \fIcount\fR was not \fBNULL\fR the count of interrupts has been atomically stored to \fIcount\fR and reset\&.

.TP
\fBE1284_NOTAVAIL\fR
The \fIcount\fR parameter was not \fBNULL\fR but interrupt counting is not supported on this type of port\&. The interrupt has been cleared\&.

.TP
\fBE1284_SYS\fR
There was a problem clearing the interrupt\&.

.TP
\fBE1284_INVALIDPORT\fR
The \fIport\fR parameter is invalid (for instance, perhaps the \fIport\fR is not claimed)\&.


.SH AUTHOR
Tim Waugh <twaugh@redhat\&.com>.
