1 #include <sys/unistd.h>
7 execv (const char *path
, char * const *args
) {
8 extern int execve (const char *, char * const *, char * const*);
9 return execve (path
, args
, environ
);
13 execl(const char *path
, const char *arg1
, ...) {
14 return execv (path
, &arg1
);
18 * Copy string, until c or <nul> is encountered.
19 * NUL-terminate the destination string (s1).
23 strccpy (char *s1
, char *s2
, char c
) {
25 while (*s2
&& *s2
!= c
) {
33 execvp(const char *file
, char * const *args
) {
34 extern char *getenv (const char *);
35 char *path
= getenv ("PATH");
38 if (file
[0] == '/') { /* absolute pathname -- easy out */
39 return execv (file
, args
);
42 buf
[0] = 0; /* lots of initialization here 8-) */
44 strccpy (buf
, path
, ':');
50 while (*path
&& *path
!= ':')