fix: several builtins *

With the fork, the builtins didn't have access to the parent process values.
This commit is contained in:
mcolonna 2024-07-01 14:33:38 +02:00
parent c637b5f382
commit 7d38a40717
4 changed files with 46 additions and 37 deletions

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:15:12 by mcolonna #+# #+# */
/* Updated: 2024/06/28 15:26:29 by mcolonna ### ########.fr */
/* Updated: 2024/07/01 14:10:47 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,22 +15,26 @@
# include "include.h"
// for the 'std' parameter in all these functions:
// - std[0] is stdin
// - std[1] is stdout
// Check if the command is a builtin.
bool is_builtin(const char *str);
// Execute the builtin command
int exec_builtin(t_env *env, t_call call);
int exec_builtin(t_env *env, t_call call, int std[2]);
// Execute echo builtin
int echo_builtin(t_env *env, t_call call);
int echo_builtin(t_env *env, t_call call, int std[2]);
// Execute cd builtin
int cd_builtin(t_env *env, t_call call);
int cd_builtin(t_env *env, t_call call, int std[2]);
// Execute export builtin
int export_builtin(t_env *env, t_call call);
int export_builtin(t_env *env, t_call call, int std[2]);
// Execute exit builtin
int exit_builtin(t_env *env, t_call call);
int exit_builtin(t_env *env, t_call call, int std[2]);
#endif