home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
EXEC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
2KB
|
96 lines
/*
execxxx stuff for MiNT/TOS; written by Eric R. Smith, and
placed in the public domain
*/
#include <stdarg.h>
#include <process.h>
#include <stdio.h>
#include <errno.h>
extern char **environ;
int
execve(path, argv, envp)
char *path;
char **argv;
char **envp;
{
return _spawnve(P_OVERLAY, path, argv, envp);
}
int
execv(path, argv)
char *path;
char **argv;
{
return _spawnve(P_OVERLAY, path, argv, environ);
}
#ifdef __STDC__
int execle(char *path, ...)
#else
int execle(path)
char *path;
#endif
{
va_list args;
char ***envp;
va_start(args, path);
for (envp = (char ***) args ; *envp ; envp++)
;
return _spawnve(P_OVERLAY, path, (char **)args, *(envp+1));
}
#ifdef __STDC__
int execl(char *path, ...)
#else
int execl(path)
char *path;
#endif
{
va_list args;
va_start(args, path);
return _spawnve(P_OVERLAY, path, (char **)args, environ);
}
/* execvp, execlp: try to execute a program on the default system
execution path. WARNING: the current directory is always searched
first.
*/
extern char *findfile(), *getenv();
static char *extensions[] = { "ttp", "prg", "tos", NULL };
int
execvp(name, argv)
char *name;
char **argv;
{
char *execname;
execname = findfile(name, getenv("PATH"), extensions);
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);
}