Skip to Main Content
Hands-On System Programming with Linux
book

Hands-On System Programming with Linux

by Kaiwan N. Billimoria, Tigran Aivazian
October 2018
Beginner content levelBeginner
794 pages
19h 23m
English
Packt Publishing
Content preview from Hands-On System Programming with Linux

The low – level design and code

This simple program will allow you to set up the number of seconds to run and to walk. It will time out accordingly.

In this application, we use a simple one-shot POSIX timer to do the job. We set the timer to use signal notification as the timer expiry notification mechanism. We set up a signal handler for a RT signal (SIGRTMIN). Next, we initially set the POSIX timer to expire after the run period, then, when the signal does arrive in the signal handler, we reset (re-arm) the timer to expire after the walk period seconds. This essentially repeats forever, or until the user aborts the program by pressing ^C.

For readability, only key parts of the source code are displayed in the following; to view the complete ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming Techniques

Linux System Programming Techniques

Jack-Benny Persson
Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini

Publisher Resources

ISBN: 9781788998475Supplemental Content