OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [posix/] [execlp.c] - Blame information for rev 39

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/* execlp.c */
2
 
3
/* This and the other exec*.c files in this directory require
4
   the target to provide the _execve syscall.  */
5
 
6
#include <_ansi.h>
7
#include <unistd.h>
8
 
9
#ifdef _HAVE_STDC
10
 
11
#include <stdarg.h>
12
 
13
int
14
execlp (_CONST char *path, _CONST char *arg0, ...)
15
 
16
#else
17
 
18
#include <varargs.h>
19
 
20
int
21
execlp (path, arg0, va_alist)
22
     _CONST char *path;
23
     _CONST char *arg0;
24
     va_dcl
25
 
26
#endif
27
 
28
{
29
  int i;
30
  va_list args;
31
  _CONST char *argv[256];
32
 
33
  va_start (args, arg0);
34
  argv[0] = arg0;
35
  i = 1;
36
  do
37
      argv[i] = va_arg (args, _CONST char *);
38
  while (argv[i++] != NULL);
39
  va_end (args);
40
 
41
  return execvp (path, (char * _CONST *) argv);
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.