⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

cow_fork

Function cow_fork 

Source
pub fn cow_fork() -> Result<ProcessId, KernelError>
Expand description

Fork with copy-on-write semantics.

Instead of physically copying all user pages, this function:

  1. Clones the address space metadata (full copy of page tables).
  2. Registers shared frames in the COW table with ref_count = 2.

When either process writes to a COW page, the page fault handler allocates a private copy and decrements the COW ref count.