Skip to content

Instantly share code, notes, and snippets.

@BitsByWill
Last active November 6, 2021 03:39
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
sigset_t sigs;
sigemptyset(&sigs);
sigaddset(&sigs, SIGALRM);
sigprocmask(SIG_BLOCK, &sigs, 0);
if (argc > 1)
{
execvp(argv[1], argv + 1);
perror("execv");
}
else
{
fprintf(stderr, "Usage: %s <command> [args...]\n", argv[0]);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment