2022-12-23 14:51:26 +00:00
|
|
|
#include <stdio.h> /* fprintf(3), NULL */
|
|
|
|
#include <unistd.h> /* execv(3), */
|
2022-06-14 21:06:39 +00:00
|
|
|
|
2023-01-07 22:24:56 +00:00
|
|
|
#if !defined EX_USAGE
|
|
|
|
# include <sysexits.h> /* EX_USAGE */
|
|
|
|
#endif
|
|
|
|
|
2022-06-14 21:06:39 +00:00
|
|
|
static char *program_name = "simexec";
|
2022-05-15 00:55:12 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
|
|
|
|
if(argc < 2){
|
2022-12-23 14:51:26 +00:00
|
|
|
fprintf(stderr, "Usage: %s [pathname] [argv...]\n",
|
|
|
|
argv[0] == NULL ? program_name : argv[0]
|
|
|
|
);
|
2022-05-15 00:55:12 +00:00
|
|
|
return EX_USAGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return execv(argv[1], argv+2);
|
|
|
|
}
|