Last change
on this file since 577 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
551 bytes
|
Rev | Line | |
---|
[444] | 1 | #ifndef _NO_EXECVE |
---|
| 2 | |
---|
| 3 | /* execlp.c */ |
---|
| 4 | |
---|
| 5 | /* This and the other exec*.c files in this directory require |
---|
| 6 | the target to provide the _execve syscall. */ |
---|
| 7 | |
---|
| 8 | #include <_ansi.h> |
---|
| 9 | #include <unistd.h> |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | #include <stdarg.h> |
---|
| 13 | |
---|
| 14 | int |
---|
| 15 | execlp (const char *path, |
---|
| 16 | const char *arg0, ...) |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | { |
---|
| 20 | int i; |
---|
| 21 | va_list args; |
---|
| 22 | const char *argv[256]; |
---|
| 23 | |
---|
| 24 | va_start (args, arg0); |
---|
| 25 | argv[0] = arg0; |
---|
| 26 | i = 1; |
---|
| 27 | do |
---|
| 28 | argv[i] = va_arg (args, const char *); |
---|
| 29 | while (argv[i++] != NULL); |
---|
| 30 | va_end (args); |
---|
| 31 | |
---|
| 32 | return execvp (path, (char * const *) argv); |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | #endif /* !_NO_EXECVE */ |
---|
Note: See
TracBrowser
for help on using the repository browser.