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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [posix/] [execle.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
/* execle.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
execle (_CONST char *path, _CONST char *arg0, ...)
15
 
16
#else
17
 
18
#include <varargs.h>
19
 
20
int
21
execle (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 * _CONST *envp;
32
  _CONST char *argv[256];
33
 
34
  va_start (args, arg0);
35
  argv[0] = arg0;
36
  i = 1;
37
  do
38
    argv[i] = va_arg (args, _CONST char *);
39
  while (argv[i++] != NULL);
40
  envp = va_arg (args, _CONST char * _CONST *);
41
  va_end (args);
42
 
43
  return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp);
44
}

powered by: WebSVN 2.1.0

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