Update MentOs code to the latest development version.

This commit is contained in:
Enrico Fraccaroli
2021-10-04 11:44:02 +02:00
parent 6fd063984a
commit b01eccca2e
484 changed files with 42358 additions and 20285 deletions
+29
View File
@@ -0,0 +1,29 @@
/// MentOS, The Mentoring Operating system project
/// @file t_setenv.c
/// @brief
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include <stdio.h>
#include <stdlib.h>
#include <sys/unistd.h>
#include <sys/wait.h>
int main(int argc, char *argv[])
{
char *_argv[] = { "/bin/tests/t_getenv", NULL };
int status;
if (setenv("ENV_VAR", "pwd0", 0) == -1) {
printf("Failed to set env: `PWD`\n");
return 1;
}
if (fork() == 0) {
execv(_argv[0], _argv);
printf("This is bad, I should not be here! EXEC NOT WORKING\n");
}
wait(&status);
return 0;
}