Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Pay attention to FORK_SHARECWD, FORK_SHAREFILES, an...
details: https://anonhg.NetBSD.org/src/rev/1999b52f8aba
branches: trunk
changeset: 472509:1999b52f8aba
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri Apr 30 21:39:51 1999 +0000
description:
Pay attention to FORK_SHARECWD, FORK_SHAREFILES, and FORK_SHARESIGS.
diffstat:
sys/kern/kern_fork.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diffs (39 lines):
diff -r 929c8b8d06d1 -r 1999b52f8aba sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c Fri Apr 30 21:23:49 1999 +0000
+++ b/sys/kern/kern_fork.c Fri Apr 30 21:39:51 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_fork.c,v 1.56 1999/04/30 21:23:49 thorpej Exp $ */
+/* $NetBSD: kern_fork.c,v 1.57 1999/04/30 21:39:51 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -276,8 +276,15 @@
if (p2->p_textvp)
VREF(p2->p_textvp);
- p2->p_fd = fdcopy(p1);
- p2->p_cwdi = cwdinit(p1);
+ if (flags & FORK_SHAREFILES)
+ fdshare(p1, p2);
+ else
+ p2->p_fd = fdcopy(p1);
+
+ if (flags & FORK_SHARECWD)
+ cwdshare(p1, p2);
+ else
+ p2->p_cwdi = cwdinit(p1);
/*
* If p_limit is still copy-on-write, bump refcnt,
@@ -317,7 +324,10 @@
/*
* Create signal actions for the child process.
*/
- p2->p_sigacts = sigactsinit(p1);
+ if (flags & FORK_SHARESIGS)
+ sigactsshare(p1, p2);
+ else
+ p2->p_sigacts = sigactsinit(p1);
/*
* This begins the section where we must prevent the parent
Home |
Main Index |
Thread Index |
Old Index