Created
May 24, 2020 21:38
-
-
Save TheDcoder/6fcfda105e9216f15ddba7b5d3405345 to your computer and use it in GitHub Desktop.
POSIX pause utility
This file contains 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 characters
#include <unistd.h> | |
#include <signal.h> | |
/* A simply utility to call the POSIX pause function, | |
* it will keep running and while ignoring SIGINT. | |
* | |
* Useful for simulating a hung process | |
*/ | |
int main() { | |
signal(SIGINT, SIG_IGN); | |
while (1) pause(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment