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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [posix/] [execle.c] - Blame information for rev 207

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#ifndef _NO_EXECVE
2
 
3
/* execle.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(execle, (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(execle, (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 * _CONST *envp;
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
  envp = va_arg (args, _CONST char * _CONST *);
45
  va_end (args);
46
 
47
  return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp);
48
}
49
 
50
#endif /* !_NO_EXECVE  */

powered by: WebSVN 2.1.0

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