source: trunk/minix/lib/posix/_execle.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 590 bytes
Line 
1/* execle() - execute with a custom environment Author: Kees J. Bot
2 * 21 Jan 1994
3 */
4#define nil 0
5#define execle _execle
6#define execve _execve
7#include <unistd.h>
8#include <stdarg.h>
9
10int execle(const char *path, const char *arg1, ...)
11/* execle("/bin/sh", "sh", "-c", "example", (char *) 0, my_env_array); */
12{
13 char * const * envp;
14 va_list ap;
15
16 va_start(ap, arg1);
17
18 /* Find the end of the argument array. */
19 if (arg1 != nil) while (va_arg(ap, const char *) != nil) {}
20
21 envp = va_arg(ap, char * const *);
22 va_end(ap);
23
24 return execve(path, (char * const *) &arg1, envp);
25}
Note: See TracBrowser for help on using the repository browser.