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

Running of case 2 – SA_NODEFER bit set

Next, we execute the test case, wherein the SA_NODEFER flag is set (first ensure you have killed off any old instances of the defer_or_not process):

$ ./defer_or_not 2PID 3215: running with the SA_NODEFER signal flag SetProcess awaiting signals ...

Now, in another Terminal window, we run the shell script:

$ ./bombard_sig.sh $(pgrep defer_or_not) 12

As soon as the script runs, firing off (12) signals to the process, the output is as follows:

sighdlr: signal 10, s=1 ; total=1; stack 0x7ffe9e17a0b0 :sighdlr: signal 10, s=2 ; total=2; stack 0x7ffe9e1799b0 :2sighdlr: signal 10, s=3 ; total=3; stack 0x7ffe9e1792b0 :3sighdlr: signal 10, s=4 ; total=4; stack 0x7ffe9e178bb0 :4sighdlr: signal 10, s=5 ; total=5; ...
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