tools/toollib: remove from main Makefile.in
[AROS.git] / compiler / posixc / execv.c
blobb325bdcbf3032c8a2712f66975952ac5f62d7017
1 /*
2 Copyright © 2008-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 function execv().
6 */
8 #include <aros/debug.h>
10 #include <fcntl.h>
11 #include <unistd.h>
12 #include <errno.h>
13 #include <assert.h>
14 #include <stdlib.h>
16 #include "__exec.h"
18 /*****************************************************************************
20 NAME */
21 #include <unistd.h>
23 int execv(
25 /* SYNOPSIS */
26 const char *path,
27 char *const argv[])
29 /* FUNCTION
30 Executes a file located in given path with specified arguments.
32 INPUTS
33 path - Pathname of the file to execute.
34 argv - Array of arguments given to main() function of the executed
35 file.
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
48 execve(), execl(), execlp(), execvp()
50 INTERNALS
52 ******************************************************************************/
54 char ***environptr = __posixc_get_environptr();
55 char **environ = (environptr != NULL) ? *environptr : NULL;
56 APTR id = __exec_prepare(path, 0, argv, environ);
57 if (!id)
58 return -1;
60 __exec_do(id);
62 assert(0); /* Should not be reached */
63 return -1;
64 } /* execv() */