Skip to content

Instantly share code, notes, and snippets.

@BitsByWill
Last active June 25, 2024 22:31
Show Gist options
  • Save BitsByWill/cf766d3e1134644a02e04bf0fabf5f18 to your computer and use it in GitHub Desktop.
Save BitsByWill/cf766d3e1134644a02e04bf0fabf5f18 to your computer and use it in GitHub Desktop.
#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