
/* (C)opyleft Jedi/Sector One <j at pureftpd.org> */

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>

int main(const int a, char * const *b)
{
    if (a < 3) {
        puts("Usage: alarmer <timeout (seconds)> <command> [args] [...]");
        return 1;
    }
    b++;
    (void) alarm((unsigned int) strtoul(*b, NULL, 10));
    b++;
    (void) execvp(*b, b);
    perror("Unable to spawn the command");
    
    return 2;
}
