Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / posix / execl.c
blobc3b4e55bd485387c8fa9016f3482959437621250
1 #ifndef _NO_EXECVE
3 /* execl.c */
5 /* This and the other exec*.c files in this directory require
6 the target to provide the _execve syscall. */
8 #include <_ansi.h>
9 #include <unistd.h>
11 /* Only deal with a pointer to environ, to work around subtle bugs with shared
12 libraries and/or small data systems where the user declares his own
13 'environ'. */
14 static char ***p_environ = &environ;
17 #include <stdarg.h>
19 int
20 execl (const char *path,
21 const char *arg0, ...)
25 int i;
26 va_list args;
27 const char *argv[256];
29 va_start (args, arg0);
30 argv[0] = arg0;
31 i = 1;
33 argv[i] = va_arg (args, const char *);
34 while (argv[i++] != NULL);
35 va_end (args);
37 return _execve (path, (char * const *) argv, *p_environ);
39 #endif /* !_NO_EXECVE */