Suppose I have to open firefox, crome or any other application ( except command line ) in linux then in that case what I have to pass in execl() function.
execl( "/usr/bin/firefox", "/usr/bin/firefox", (char *) NULL ); The first argument is the executable, then it comes arg0 (that by convention points to the file to be executed), arg1, ..., and ends with a NULL pointer.
execl giving error code 1
man wrote:
If any of the exec() functions returns, an error will have occurred.
The return value is -1, and errno will be set to indicate the error.