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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [newlib-1.18.0/] [newlib/] [libc/] [posix/] [execlp.c] - Blame information for rev 842

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

Line No. Rev Author Line
1 207 jeremybenn
#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
#ifdef _HAVE_STDC
12
 
13
#include <stdarg.h>
14
 
15
int
16
_DEFUN(execlp, (path, arg0, ...),
17
      _CONST char *path _AND
18
      _CONST char *arg0 _DOTS)
19
 
20
#else
21
 
22
#include <varargs.h>
23
 
24
int
25
_DEFUN(execlp, (path, arg0, va_alist),
26
     _CONST char *path _AND
27
     _CONST char *arg0 _AND
28
     va_dcl)
29
 
30
#endif
31
 
32
{
33
  int i;
34
  va_list args;
35
  _CONST char *argv[256];
36
 
37
  va_start (args, arg0);
38
  argv[0] = arg0;
39
  i = 1;
40
  do
41
      argv[i] = va_arg (args, _CONST char *);
42
  while (argv[i++] != NULL);
43
  va_end (args);
44
 
45
  return execvp (path, (char * _CONST *) argv);
46
}
47
 
48
#endif /* !_NO_EXECVE  */

powered by: WebSVN 2.1.0

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