Created
February 23, 2017 02:40
-
-
Save makerj/a16dcb3e38d252df56c5cb43a14c9f3b to your computer and use it in GitHub Desktop.
Revisions
-
makerj created this gist
Feb 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // once struct sigaction sigact, old_sigact; sigact.sa_handler = handler; sigemptyset(&sigact.sa_mask); sigact.sa_flags = SA_INTERRUPT; sigaction(SIGALRM, &sigact, &old_sigact) < 0); // somewhere loop while(1) { alarm(5); blocking_task(); alarm(0); }