Kernel: add basic support for environment variables

exec functions will search files from PATH
This commit is contained in:
Bananymous
2023-06-05 21:53:37 +03:00
parent 290b81dedc
commit 55ea5c5488
5 changed files with 137 additions and 37 deletions

View File

@@ -43,13 +43,6 @@ int execute_command(BAN::StringView command)
}
else
{
struct stat stat_buf;
if (stat(args.front(), &stat_buf) == -1)
{
fprintf(stderr, "command not found: %s\n", args.front());
return 1;
}
pid_t pid = fork();
if (pid == 0)
{
@@ -60,7 +53,7 @@ int execute_command(BAN::StringView command)
}
if (pid == -1)
{
perror("fork()");
perror("fork");
return 1;
}
int status;