home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Mint
/
mntlib32.zoo
/
execp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-25
|
1KB
|
53 lines
/*
execxxx stuff for MiNT/TOS; written by Eric R. Smith, and
placed in the public domain
uo, 3.5.93: replaced findfile -> buffindfile (no static buffer
anymore)
*/
#include <stdarg.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <limits.h>
#include <support.h>
/* execvp, execlp: try to execute a program on the default system
execution path. WARNING: the current directory is always searched
first.
*/
static char *extensions[] = { "ttp", "prg", "tos", NULL };
#ifdef __STDC__
int execvp(char *name, char **argv)
#else
int execvp(name, argv) char *name; char **argv;
#endif
{
char *execname;
char buffer[PATH_MAX];
execname = buffindfile(name, getenv("PATH"), extensions,buffer);
if (!execname) {
errno = ENOENT;
return -1; /* file not found */
}
return _spawnve(P_OVERLAY, execname, argv, (char **)NULL);
}
#ifdef __STDC__
int execlp(char *name, ...)
#else
int execlp(name)
char *name;
#endif
{
va_list args;
va_start(args, name);
return execvp(name, (char **)args);
}