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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [posix/] [execl.c] - Blame information for rev 1773

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

Line No. Rev Author Line
1 1010 ivang
/* execl.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
/* Only deal with a pointer to environ, to work around subtle bugs with shared
10
   libraries and/or small data systems where the user declares his own
11
   'environ'.  */
12
static char ***p_environ = &environ;
13
 
14
#ifdef _HAVE_STDC
15
 
16
#include <stdarg.h>
17
 
18
int
19
execl (_CONST char *path, _CONST char *arg0, ...)
20
 
21
#else
22
 
23
#include <varargs.h>
24
 
25
int
26
execl (path, arg0, va_alist)
27
     _CONST char *path;
28
     _CONST char *arg0;
29
     va_dcl
30
 
31
#endif
32
 
33
{
34
  int i;
35
  va_list args;
36
  _CONST char *argv[256];
37
 
38
  va_start (args, arg0);
39
  argv[0] = arg0;
40
  i = 1;
41
  do
42
      argv[i] = va_arg (args, _CONST char *);
43
  while (argv[i++] != NULL);
44
  va_end (args);
45
 
46
  return _execve (path, (char * _CONST  *) argv, *p_environ);
47
}

powered by: WebSVN 2.1.0

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