I am interested in finding which variant of the exec*()
family of functions does the Bash shell use in order to launch programs. For example, the system()
function uses execl()
, but what does Bash use?
I did some investigation, but I want to double check with everyone if this is the right place in the Bash source code where a command entered from the terminal is executed.
I investigated Bash version 4.2.53, and found a file called execute_cmd.c
. In there I observe the following chain of calls:
execute_disk_command()
// I think this is where bash forks a child
pid = make_child (savestring (command_line), async);
...
exit (shell_execve (command, args, export_env));
shell_execve (command, args, env)
// I think this is where the child invokes the new program
execve (command, args, env);
Is the control flow above the right one?