Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <unistd.h>
2
#include <string.h>
3
#include <sys/limits.h>
4
 
5
/*
6
 * BUG: instead of looking at PATH env variable,
7
 * just try prepending /bin/ if name fails...
8
 */
9
 
10
extern char **environ;
11
 
12
int
13
execlp(const char *name, const char *arg0, ...)
14
{
15
	int n;
16
	char buf[PATH_MAX];
17
 
18
	if((n=execve(name, &arg0, environ)) < 0){
19
		strcpy(buf, "/bin/");
20
		strcpy(buf+5, name);
21
		n = execve(buf, &name+1, environ);
22
	}
23
	return n;
24
}