-#if 0
- /*
- * Duplicate the process address space.
- * XXX if this is a vfork we arrange to share data/stack to
- * preserve brain-dead semantics of vfork().
- * XXX this doesn't work due to a bug in the VM code.
- * Once a process has done a vfork setting up sharing maps,
- * any future forks may fail as the source VM range doesn't
- * properly get write-protected. This causes the parent to
- * not create copies and instead modifies the originals.
- * If the parent activates before the child, the child will
- * get a corrupted address space.
- */
- if (isvfork) {
- addr = trunc_page(u.u_daddr);
- size = ctob(u.u_dsize);
- (void) vm_map_inherit(u.u_procp->p_map, addr,
- addr + size, VM_INHERIT_SHARE);
- (void) vm_map_inherit(u.u_procp->p_map, u.u_maxsaddr,
- VM_MAX_ADDRESS, VM_INHERIT_SHARE);
- }
-#endif
- p->p_map = vm_map_fork(u.u_procp->p_map);
-#if 0
- if (isvfork) {
- (void) vm_map_inherit(u.u_procp->p_map, addr,
- addr + size, VM_INHERIT_COPY);
- (void) vm_map_inherit(u.u_procp->p_map, u.u_maxsaddr,
- VM_MAX_ADDRESS, VM_INHERIT_COPY);
- }