arch/m68k-amiga: Define the gcc symbol 'start' instead of using .bss
[AROS.git] / compiler / clib / execvp.c
blobc35b78c543f56197032a1c118a12267a4f375c16
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX function execvp().
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 execvp(
25 /* SYNOPSIS */
26 const char *file,
27 char *const argv[])
29 /* FUNCTION
30 Executes a file with given name. The search paths for the executed
31 file are paths specified in the PATH environment variable.
33 INPUTS
34 file - Name of the file to execute.
35 argv - Array of arguments given to main() function of the executed
36 file.
38 RESULT
39 Returns -1 and sets errno appropriately in case of error, otherwise
40 doesn't return.
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
49 execve(), execl(), execlp(), execv()
51 INTERNALS
53 ******************************************************************************/
55 APTR id = __exec_prepare(file, 1, argv, environ);
56 if(!id)
57 return -1;
59 __exec_do(id);
61 assert(0); /* not reached */
62 return -1;
63 } /* execvp() */