summaryrefslogtreecommitdiff
path: root/libc/unistd/execl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/unistd/execl.c')
-rw-r--r--libc/unistd/execl.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/libc/unistd/execl.c b/libc/unistd/execl.c
deleted file mode 100644
index b2c6dd5a0..000000000
--- a/libc/unistd/execl.c
+++ /dev/null
@@ -1,46 +0,0 @@
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-int execl(__const char *path, __const char *arg, ...)
-{
- const char *shortargv[16];
- const char **argv;
- const char *c;
- int i;
- va_list args;
-
- i = 1;
-
- va_start(args, arg);
-
- do {
- c = va_arg(args, const char *);
-
- i++;
- } while (c);
-
- va_end(args);
-
- if (i <= 16)
- argv = shortargv;
- else {
- argv = (const char **) alloca(sizeof(char *) * i);
- }
-
- argv[0] = arg;
- i = 1;
-
- va_start(args, arg);
-
- do {
- argv[i] = va_arg(args, const char *);
- } while (argv[i++]);
-
- va_end(args);
-
- i = execve(path, (char *const *) argv, __environ);
-
- return i;
-}