summaryrefslogtreecommitdiff
path: root/src/unistd/execvp.c
blob: a7561184688aa853ee615d6832a2e9b3c6a36f34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#if 0

#include <sys/types.h>
#include <unistd.h>
#include <errno.h>

int execvp(const char *file, char *const argv[])
{
	extern char **environ;
	/* search $PATH for file */
	execve(file, argv, environ);
	if (errno == ENOEXEC) {
		/* stuff /bin/sh in front */
		char sh[] = "/bin/sh";
		return execve(sh, argv, environ);
	}
	return -1;
}
/*
POSIX(1)
*/


#endif