aboutsummaryrefslogtreecommitdiffstats
path: root/exec-as.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-10-17 17:29:06 +0200
committerMattias Andrée <maandree@kth.se>2017-10-17 17:29:06 +0200
commitd04679a2e30ecc35a68e876829984c9dfba710e4 (patch)
tree209cb4a0962153e7ca948d82e7efaa9b3db750ae /exec-as.c
parentupdate dist (diff)
downloadexec-as-d04679a2e30ecc35a68e876829984c9dfba710e4.tar.gz
exec-as-d04679a2e30ecc35a68e876829984c9dfba710e4.tar.bz2
exec-as-d04679a2e30ecc35a68e876829984c9dfba710e4.tar.xz
Rewrite and relicense1.2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'exec-as.c')
-rw-r--r--exec-as.c18
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;
+}