fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / posix / execle.c
blobefe204d86cb13d8fc0ebbb82f07c7628839f7640
1 /* execle.c */
3 /* This and the other exec*.c files in this directory require
4 the target to provide the _execve syscall. */
6 #include <_ansi.h>
7 #include <unistd.h>
9 #ifdef _HAVE_STDC
11 #include <stdarg.h>
13 int
14 _DEFUN(execle, (path, arg0, ...),
15 _CONST char *path _AND
16 _CONST char *arg0 _DOTS)
18 #else
20 #include <varargs.h>
22 int
23 _DEFUN(execle, (path, arg0, va_alist),
24 _CONST char *path _AND
25 _CONST char *arg0 _AND
26 va_dcl)
28 #endif
31 int i;
32 va_list args;
33 _CONST char * _CONST *envp;
34 _CONST char *argv[256];
36 va_start (args, arg0);
37 argv[0] = arg0;
38 i = 1;
40 argv[i] = va_arg (args, _CONST char *);
41 while (argv[i++] != NULL);
42 envp = va_arg (args, _CONST char * _CONST *);
43 va_end (args);
45 return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp);