BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / 381dc7b37e5dfe249412ce3559e8b0dcd56f6267 / task / clone.c

// Related

Nucleus

Barry Virtual Memory Regions and namespace 381dc7b (3 years, 3 months ago)
diff --git a/task/clone.c b/task/clone.c
index c9a6dc0..0ec2f95 100644
--- a/task/clone.c
+++ b/task/clone.c
@@ -32,6 +32,12 @@ clone(int flags)
 	else
 		child->files = copy(parent->files);
 
+	/* Clone parent's virtual memory namespace */
+	if (flags & CLONE_VM)
+		child->vm = get(parent->fs);
+	else
+		child->fs = copy(parent->fs);
+
 	/* After this, anything on the stack is desynchronised */
 	child->pageDir = clone_dir();