Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Device Driver Development Cookbook

You're reading from   Linux Device Driver Development Cookbook Learn kernel programming and build custom drivers for your embedded Linux applications

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781838558802
Length 356 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rodolfo Giometti Rodolfo Giometti
Author Profile Icon Rodolfo Giometti
Rodolfo Giometti
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Installing the Development System FREE CHAPTER 2. A Peek Inside the Kernel 3. Working with Char Drivers 4. Using the Device Tree 5. Managing Interrupts and Concurrency 6. Miscellaneous Kernel Internals 7. Advanced Char Driver Operations 8. Additional Information: Working with Char Drivers 9. Additional Information: Using the Device Tree 10. Additional Information: Managing Interrupts and Concurrency 11. Additional Information: Miscellaneous Kernel Internals 12. Additional Information: Advanced Char Driver Operations 13. Other Books You May Enjoy

Managing asynchronous notifications with fasync()

In the previous section, we considered the special case in which we can have a process that must manage more than one peripheral. In this situation, we can ask the kernel, which is the ready file descriptor, where to get data from or where to write data to using the poll() or select() system call. However, this is not the only solution. Another possibility is to use the fasync() method.

By using this method, we can ask the kernel to send a signal (usually SIGIO) whenever a new event has occurred on a file descriptor; the event, of course, is a ready-to-read or read-to-write event and the file descriptor is the one connected with our peripheral.

The fasync() method does not have a userspace counterpart due to the already presented methods in this book; there is no fasync() system call at all. We can use it indirectly by utilizing...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime