Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/sys/src/ape/lib/ap/plan9/execlp.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | 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
}