Skip to content

Instantly share code, notes, and snippets.

@TheDcoder
Created May 24, 2020 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheDcoder/6fcfda105e9216f15ddba7b5d3405345 to your computer and use it in GitHub Desktop.
Save TheDcoder/6fcfda105e9216f15ddba7b5d3405345 to your computer and use it in GitHub Desktop.
POSIX pause utility
#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