IEEE1284_GET_IRQ_FD(3)
okay bestie, pull up a chair π«Ά you just landed on ieee1284_get_irq_fd(3) β that's the one from the Functions section of the manual, and it's all about interrupt notification. Let's get into it. π
πΈ NAME πΈ
ieee1284_get_irq_fd, ieee1284_clear_irq β interrupt notification, aka "hey bestie, tell me when the port pokes me" π
β¨ SYNOPSIS β¨
#include <ieee1284.h>
int ieee1284_get_irq_fd(struct parport *port);
int ieee1284_clear_irq(struct parport *port, unsigned int *count);
π¦ DESCRIPTION π¦
So here's the vibe. If the port has a configured interrupt line and the port type supports interrupt notification, then you can literally get yourself a file descriptor that works with select(2) or poll(2). π
Any event β readable, writable, or exception β means an interrupt has been triggered. That's it, that's the signal. π
β οΈ No operations other thanselectorpollmay be performed on the file descriptor. Not even a lil peek. Do NOT.
The port must be open in order to call ieee1284_get_irq_fd, and it must be claimed when you're using select or poll. Two separate conditions, both required, no skipping. β
Also, and this is important:
- The caller must not close the file descriptor π ββοΈ
- The caller may not use it at all when the port is not claimed
Then, once an interrupt has been detected, the caller must call ieee1284_clear_irq to clear the interrupt condition. π§Ή And here's the cute part: at that moment you can grab the number of interrupts raised by supplying a non-NULL count. π
π RETURN VALUE π
For ieee1284_get_irq_fd π
If the return value is negative then it's an error code (listed below). Otherwise? It's a valid file descriptor, and you're so back. π
E1284_NOTAVAILβ No such file descriptor is available. πE1284_INVALIDPORTβ Theportparameter is invalid (for instance, perhaps the port is not open). π
For ieee1284_clear_irq π
E1284_OKβ The interrupt has been cleared. And ifcountwas notNULL, the count of interrupts has been atomically stored tocountand reset. Slay. β¨E1284_NOTAVAILβ Thecountparameter was notNULLbut interrupt counting is not supported on this type of port. The interrupt has been cleared, though, so don't cry. π«ΆE1284_SYSβ There was a problem clearing the interrupt. πE1284_INVALIDPORTβ Theportparameter is invalid (for instance, perhaps the port is not claimed). π
π AUTHOR π
Tim Waugh <twaugh@redhat.com>
- Author. π
π§ COPYRIGHT π§
Copyright Β© 2001-2003 Tim Waugh
and that's the whole page, bestie, no notes. this one shipped as part of the 09/18/2007 release of the IEEE1284_GET_IRQ_FD(3) page β iconic date, iconic energy, go clear some interrupts responsibly πβ¨π¦
π¦ where this page comes from
- alpine 3.24: libieee1284-doc 0.2.11-r4 Β· GPL-2.0-or-later
- debian bookworm: libieee1284-3-dev 0.2.11-14
- debian trixie: libieee1284-3-dev 0.2.11-14.1+b1
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- ubuntu jammy: libieee1284-3-dev 0.2.11-14build2
- ubuntu noble: libieee1284-3-dev 0.2.11-14.1build1
- ubuntu questing: libieee1284-3-dev 0.2.11-14.1build1
- ubuntu resolute: libieee1284-3-dev 0.2.11-14.1build2
- ubuntu stonking: libieee1284-3-dev 0.2.11-15 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms