diff options
author | dyson <dyson@FreeBSD.org> | 1997-01-31 04:10:41 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-01-31 04:10:41 +0000 |
commit | 0ebe30bff054897d67eade0ea798219f0b1e0234 (patch) | |
tree | 9c40cf9e4f110f1c9a9e8ed9c9bb8f4af6a43af8 /sys/vm/vm_map.c | |
parent | 2b6aeca8b69f4a6f7e603fd4782fcbcc47a8efa8 (diff) | |
download | FreeBSD-src-0ebe30bff054897d67eade0ea798219f0b1e0234.zip FreeBSD-src-0ebe30bff054897d67eade0ea798219f0b1e0234.tar.gz |
Another fix to inheriting shared segments. Do the copy on write
thing if needed.
Submitted by: Alan Cox <alc@cs.rice.edu>
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 68cf4e1..bc3bea9 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2157,7 +2157,15 @@ vmspace_fork(vm1) old_entry->start)); old_entry->object.vm_object = object; old_entry->offset = (vm_offset_t) 0; - } + } else if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) { + vm_object_shadow(&old_entry->object.vm_object, + &old_entry->offset, + OFF_TO_IDX(old_entry->end - + old_entry->start)); + + old_entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; + object = old_entry->object.vm_object; + } /* * Clone the entry, referencing the sharing map. |