Kernel: fork() now copies allocation done through GeneralAllocator

This commit is contained in:
Bananymous
2023-05-28 20:37:39 +03:00
parent f2d767b799
commit f04399c3a0
4 changed files with 52 additions and 5 deletions

View File

@@ -8,15 +8,18 @@
int main()
{
char* string = (char*)malloc(5000);
strcpy(string, "Hello");
printf("forking\n");
pid_t pid = fork();
if (pid == 0)
{
printf("child\n");
printf("child '%s'\n", string);
return 0;
}
printf("parent\n");
printf("parent '%s'\n", string);
return 0;
}