exec0.c (249B)
1#include <stdio.h> 2#include <unistd.h> 3 4int 5main(int argc, char *const *argv) 6{ 7 if (argc < 3) { 8 fprintf(stderr, "Usage: exec0 BIN ARGV0 [ARG..]\n"); 9 return 1; 10 } 11 if (execvp(argv[1], argv + 2)) { 12 perror("execvp"); 13 return 1; 14 } 15 return 0; 16}