summaryrefslogtreecommitdiff
path: root/libc/unistd/execle.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2004-01-02 08:44:58 +0000
committerManuel Novoa III <mjn3@codepoet.org>2004-01-02 08:44:58 +0000
commit400e6fc264cbe6ca3ca572d94bbf5f929f256713 (patch)
tree7c7cd0d0dc3e59fe1ab7e369e73c1d521797c47b /libc/unistd/execle.c
parent33e58d3c9e1282b210313c8ee46daeb74edb99e8 (diff)
Redo the exec functions to comply with SUSv3.
Diffstat (limited to 'libc/unistd/execle.c')
-rw-r--r--libc/unistd/execle.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/libc/unistd/execle.c b/libc/unistd/execle.c
deleted file mode 100644
index 4003ee6be..000000000
--- a/libc/unistd/execle.c
+++ /dev/null
@@ -1,50 +0,0 @@
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
-
-extern int execvep(const char *path, char *const argv[], char *const envp[]);
-
-int execle(const char *file, const char *arg, ...)
-{
- const char *shortargv[16];
- const char **argv;
- const char *c;
- int i;
- va_list args;
- const char *const *envp;
-
- 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++]);
-
- envp = va_arg (args, const char *const *);
- va_end(args);
-
- i = execvep(file, (char *const *) argv, (char *const *) envp);
-
- return i;
-}