blob: 33fb0f7f3bf1da083ca8b1f05a22defa31730f24 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <unistd.h>
#include <stdarg.h>
int execlp(const char *file, ...)
{
int argc;
va_list ap;
va_start(ap, file);
for (argc=0; va_arg(ap, const char *); argc++);
va_end(ap);
{
int i;
char *argv[argc+1];
va_start(ap, file);
for (i=0; i<argc; i++)
argv[i] = va_arg(ap, char *);
argv[i] = NULL;
return execvp(file, argv);
}
}
|