summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_gzip.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-04-13 01:48:35 +0000
committerdyson <dyson@FreeBSD.org>1997-04-13 01:48:35 +0000
commit61955ab83033e59cfabb8590ba5ccbf0669d9a47 (patch)
tree8d2081b02ed11701596e498b2013cf9f5a5625dd /sys/kern/imgact_gzip.c
parent438bdd8a9c9d390f13a4b05980c19b18e974d16c (diff)
downloadFreeBSD-src-61955ab83033e59cfabb8590ba5ccbf0669d9a47.zip
FreeBSD-src-61955ab83033e59cfabb8590ba5ccbf0669d9a47.tar.gz
Fully implement vfork. Vfork is now much much faster than even our
fork. (On my machine, fork is about 240usecs, vfork is 78usecs.) Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory from the other threads of a group. Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating possible existing shares with other threads/processes. Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a thread from the rest of the group. Fix the case where a thread does an exec. It is almost nonsense for a thread to modify the other threads address space by an exec, so we now automatically divorce the address space before modifying it.
Diffstat (limited to 'sys/kern/imgact_gzip.c')
-rw-r--r--sys/kern/imgact_gzip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c
index 9a3237f..e92db9b 100644
--- a/sys/kern/imgact_gzip.c
+++ b/sys/kern/imgact_gzip.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id$
+ * $Id: imgact_gzip.c,v 1.28 1997/02/22 09:38:57 peter Exp $
*
* This module handles execution of a.out files which have been run through
* "gzip". This saves diskspace, but wastes cpu-cycles and VM.
@@ -149,7 +149,7 @@ static int
do_aout_hdr(struct imgact_gzip * gz)
{
int error;
- struct vmspace *vmspace = gz->ip->proc->p_vmspace;
+ struct vmspace *vmspace;
vm_offset_t vmaddr;
/*
@@ -227,6 +227,8 @@ do_aout_hdr(struct imgact_gzip * gz)
*/
exec_new_vmspace(gz->ip);
+ vmspace = gz->ip->proc->p_vmspace;
+
vmaddr = gz->virtual_offset;
error = vm_mmap(&vmspace->vm_map,
OpenPOWER on IntegriCloud