2 Copyright © 2008-2009, The AROS Development Team. All rights reserved.
5 POSIX function execlp().
8 #include <aros/debug.h>
13 #include "__arosc_privdata.h"
16 /*****************************************************************************
28 Executes a file with given name. The search paths for the executed
29 file are paths specified in the PATH environment variable.
32 file - Name of the file to execute.
33 arg - First argument passed to the executed file.
34 ... - Other arguments passed to the executed file.
37 Returns -1 and sets errno appropriately in case of error, otherwise
47 execve(), execl(), execv(), execvp()
51 ******************************************************************************/
53 struct aroscbase
*aroscbase
= __aros_getbase();
56 char **environ
= (aroscbase
->acb_environptr
) ? *aroscbase
->acb_environptr
: NULL
;
60 if(!(argv
= __exec_valist2array(arg
, args
)))
68 APTR id
= __exec_prepare(file
, 1, argv
, environ
);
69 __exec_cleanup_array();
75 assert(0); /* Should not be reached */