diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-03 17:39:24 -0700 |
commit | a6c1ed4716cf02626ea035beb6dd4a921642ba80 (patch) | |
tree | ef582c1b52819e27bdd16097ec03b69799d04ede /newlib/libc/sys/sysvi386/exec.c | |
parent | f6c9a624fa8a6878a7fb2b02f55e4990a20feb59 (diff) |
Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gbalibc
Diffstat (limited to 'newlib/libc/sys/sysvi386/exec.c')
-rw-r--r-- | newlib/libc/sys/sysvi386/exec.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/newlib/libc/sys/sysvi386/exec.c b/newlib/libc/sys/sysvi386/exec.c deleted file mode 100644 index 6587d50..0000000 --- a/newlib/libc/sys/sysvi386/exec.c +++ /dev/null @@ -1,54 +0,0 @@ -#include <sys/unistd.h> -#include <errno.h> - -extern char **environ; - -int -execv (const char *path, char * const *args) { - extern int execve (const char *, char * const *, char * const*); - return execve (path, args, environ); -} - -int -execl(const char *path, const char *arg1, ...) { - return execv (path, &arg1); -} - -/* - * Copy string, until c or <nul> is encountered. - * NUL-terminate the destination string (s1). - */ - -static char * -strccpy (char *s1, char *s2, char c) { - char *dest = s1; - while (*s2 && *s2 != c) { - *s1++ = *s2++; - } - *s1 = 0; - return dest; -} - -int -execvp(const char *file, char * const *args) { - extern char *getenv (const char *); - char *path = getenv ("PATH"); - char buf[MAXNAMLEN]; - - if (file[0] == '/') { /* absolute pathname -- easy out */ - return execv (file, args); - } - - buf[0] = 0; /* lots of initialization here 8-) */ - while (*path) { - strccpy (buf, path, ':'); - strcat (buf, "/"); - strcat (buf, file); - execv (buf, args); - if (errno != ENOENT) - return -1; - while (*path && *path != ':') - path++; - } - return -1; -} |