diff options
author | Mattias Andrée <maandree@kth.se> | 2017-10-17 17:29:06 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2017-10-17 17:29:06 +0200 |
commit | d04679a2e30ecc35a68e876829984c9dfba710e4 (patch) | |
tree | 209cb4a0962153e7ca948d82e7efaa9b3db750ae /exec-as.c | |
parent | update dist (diff) | |
download | exec-as-1.2.tar.gz exec-as-1.2.tar.bz2 exec-as-1.2.tar.xz |
Rewrite and relicense1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-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; +} |