compiler/clib: Removed unused arosc_init.h file.
[AROS.git] / compiler / clib / execve.c
blobff65dd5796e092ee57f1758b444fa6c924aec926
1 /*
2 Copyright © 2008-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX function execve().
6 */
8 #define DEBUG 0
10 #include <exec/types.h>
11 #include <exec/lists.h>
12 #include <proto/exec.h>
13 #include <proto/dos.h>
14 #include <aros/debug.h>
16 #include <assert.h>
17 #include <ctype.h>
18 #include <stdlib.h>
19 #include <stdio.h>
20 #include <sys/stat.h>
21 #include <unistd.h>
22 #include <errno.h>
24 #include "__exec.h"
25 #include "__upath.h"
26 #include "__fdesc.h"
27 #include "__arosc_privdata.h"
28 #include "__vfork.h"
30 /*****************************************************************************
32 NAME */
33 #include <unistd.h>
35 int execve(
37 /* SYNOPSIS */
38 const char *filename,
39 char *const argv[],
40 char *const envp[])
42 /* FUNCTION
43 Executes a file with given name.
45 INPUTS
46 filename - Name of the file to execute.
47 argv - Array of arguments provided to main() function of the executed
48 file.
49 envp - Array of environment variables passed as environment to the
50 executed program.
52 RESULT
53 Returns -1 and sets errno appropriately in case of error, otherwise
54 doesn't return.
56 NOTES
58 EXAMPLE
60 BUGS
62 SEE ALSO
64 INTERNALS
66 ******************************************************************************/
68 APTR id = __exec_prepare(filename, 0, argv, envp);
69 if(!id)
70 return -1;
72 __exec_do(id);
74 assert(0); /* Should not be reached */
75 return -1;
76 } /* execve() */