diff options
Diffstat (limited to 'exec-as.c')
-rw-r--r-- | exec-as.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/exec-as.c b/exec-as.c new file mode 100644 index 0000000..64a0f27 --- /dev/null +++ b/exec-as.c @@ -0,0 +1,18 @@ +/* See LICENSE file for copyright and license details. */ +#include <errno.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + + +int +main(int argc, char *argv[]) +{ + if (argc < 2) { + fprintf(stderr, "usage: %s command [argv0 [arg ...]]\n", argc ? argv[0] : "exec-as"); + } else { + execvp(argv[1], &argv[2]); + fprintf(stderr, "%s: execvp %s: %s\n", argv[0], argv[1], strerror(errno)); + } + return 138; +} |