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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [posix/] [execl.c] - Blame information for rev 868

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

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

powered by: WebSVN 2.1.0

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