muimaster.library: support Listview_List in List
[AROS.git] / compiler / posixc / execve.c
blob64d04f5517e59f64df65b1738f8dc177942b7c06
1 /*
2 Copyright © 2008-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 function execve().
6 */
8 #define DEBUG 0
9 #include <aros/debug.h>
11 #include <assert.h>
13 #include "__exec.h"
15 /*****************************************************************************
17 NAME */
18 #include <unistd.h>
20 int execve(
22 /* SYNOPSIS */
23 const char *filename,
24 char *const argv[],
25 char *const envp[])
27 /* FUNCTION
28 Executes a file with given name.
30 INPUTS
31 filename - Name of the file to execute.
32 argv - Array of arguments provided to main() function of the executed
33 file.
34 envp - Array of environment variables passed as environment to the
35 executed program.
37 RESULT
38 Returns -1 and sets errno appropriately in case of error, otherwise
39 doesn't return.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 ******************************************************************************/
53 APTR id = __exec_prepare(filename, 0, argv, envp);
54 if(!id)
55 return -1;
57 __exec_do(id);
59 assert(0); /* Should not be reached */
60 return -1;
61 } /* execve() */