2 Copyright © 2008-2013, The AROS Development Team. All rights reserved.
5 POSIX.1-2008 function execlp().
8 #include <aros/debug.h>
15 /*****************************************************************************
27 Executes a file with given name. The search paths for the executed
28 file are paths specified in the PATH environment variable.
31 file - Name of the file to execute.
32 arg - First argument passed to the executed file.
33 ... - Other arguments passed to the executed file.
36 Returns -1 and sets errno appropriately in case of error, otherwise
46 execve(), execl(), execv(), execvp()
50 ******************************************************************************/
54 char ***environptr
= __posixc_get_environptr();
55 char **environ
= (environptr
!= NULL
) ? *environptr
: NULL
;
59 if(!(argv
= __exec_valist2array(arg
, args
)))
67 APTR id
= __exec_prepare(file
, 1, argv
, environ
);
68 __exec_cleanup_array();
74 assert(0); /* Should not be reached */