From f95a4a932476be2ba99e2fd081e8d2bc6ea12813 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 15 Dec 2017 09:38:53 -0500 Subject: Import newlib and create makefile --- newlib/libc/posix/execlp.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 newlib/libc/posix/execlp.c (limited to 'newlib/libc/posix/execlp.c') diff --git a/newlib/libc/posix/execlp.c b/newlib/libc/posix/execlp.c new file mode 100644 index 0000000..dd04914 --- /dev/null +++ b/newlib/libc/posix/execlp.c @@ -0,0 +1,42 @@ +/* execlp.c */ + +/* This and the other exec*.c files in this directory require + the target to provide the _execve syscall. */ + +#include <_ansi.h> +#include + +#ifdef _HAVE_STDC + +#include + +int +execlp (_CONST char *path, _CONST char *arg0, ...) + +#else + +#include + +int +execlp (path, arg0, va_alist) + _CONST char *path; + _CONST char *arg0; + va_dcl + +#endif + +{ + int i; + va_list args; + _CONST char *argv[256]; + + va_start (args, arg0); + argv[0] = arg0; + i = 1; + do + argv[i] = va_arg (args, _CONST char *); + while (argv[i++] != NULL); + va_end (args); + + return execvp (path, (char * _CONST *) argv); +} -- cgit v1.2.3