diff options
author | hobbs <hobbs> | 1999-12-12 02:27:19 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-12-12 02:27:19 (GMT) |
commit | b183ce5e032c7c0f144f8f6ba001471e3d6ff802 (patch) | |
tree | 09981004145e8084f9d6e139d6691eb554f27fe7 | |
parent | cd9655fd919cf88d1b2f8ea9a542de1ba6e5649a (diff) | |
download | tcl-b183ce5e032c7c0f144f8f6ba001471e3d6ff802.zip tcl-b183ce5e032c7c0f144f8f6ba001471e3d6ff802.tar.gz tcl-b183ce5e032c7c0f144f8f6ba001471e3d6ff802.tar.bz2 |
* unix/configure.in:
* unix/tcl.m4:
* unix/tclUnixPipe.c: removed checking for compatible vfork
function and use of the vfork function. Modern VM systems rarely
suffer any performance degradation when fork is used, and it
solves multiple problems with vfork. Users that still want vfork
and add -Dfork=vfork to the compile flags. [Bug: 942 2228 1312]
-rw-r--r-- | unix/configure.in | 12 | ||||
-rw-r--r-- | unix/tcl.m4 | 62 | ||||
-rw-r--r-- | unix/tclUnixPipe.c | 6 |
3 files changed, 4 insertions, 76 deletions
diff --git a/unix/configure.in b/unix/configure.in index 316b9f8..430e944 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,7 +2,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. AC_INIT(../generic/tcl.h) -# RCS: @(#) $Id: configure.in,v 1.50 1999/10/05 22:46:40 hobbs Exp $ +# RCS: @(#) $Id: configure.in,v 1.51 1999/12/12 02:27:19 hobbs Exp $ TCL_VERSION=8.3 TCL_MAJOR_VERSION=8 @@ -334,16 +334,6 @@ if test $tcl_ok = yes; then fi #-------------------------------------------------------------------- -# Check to see whether the system provides a vfork kernel call. -# If not, then use fork instead. Also, check for a problem with -# vforks and signals that can cause core dumps if a vforked child -# resets a signal handler. If the problem exists, then use fork -# instead of vfork. -#-------------------------------------------------------------------- - -SC_HAVE_VFORK - -#-------------------------------------------------------------------- # Check whether there is an strncasecmp function on this system. # This is a bit tricky because under SCO it's in -lsocket and # under Sequent Dynix it's in -linet. diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a347af6..0b8fdda 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1445,68 +1445,6 @@ AC_DEFUN(SC_BLOCKING_STYLE, [ ]) #-------------------------------------------------------------------- -# SC_HAVE_VFORK -# -# Check to see whether the system provides a vfork kernel call. -# If not, then use fork instead. Also, check for a problem with -# vforks and signals that can cause core dumps if a vforked child -# resets a signal handler. If the problem exists, then use fork -# instead of vfork. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# vfork (=fork) -# -#-------------------------------------------------------------------- - -AC_DEFUN(SC_HAVE_VFORK, [ - AC_TYPE_SIGNAL() - AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0) - if test "$tcl_ok" = 1; then - AC_MSG_CHECKING([vfork/signal bug]); - AC_TRY_RUN([ -#include <stdio.h> -#include <signal.h> -#include <sys/wait.h> -int gotSignal = 0; -sigProc(sig) - int sig; -{ - gotSignal = 1; -} -main() -{ - int pid, sts; - (void) signal(SIGCHLD, sigProc); - pid = vfork(); - if (pid < 0) { - exit(1); - } else if (pid == 0) { - (void) signal(SIGCHLD, SIG_DFL); - _exit(0); - } else { - (void) wait(&sts); - } - exit((gotSignal) ? 0 : 1); -}], tcl_ok=1, tcl_ok=0, tcl_ok=0) - - if test "$tcl_ok" = 1; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT([buggy, using fork instead]) - fi - fi - rm -f core - if test "$tcl_ok" = 0; then - AC_DEFINE(vfork, fork) - fi -]) - -#-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 3db9228..0e26414 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPipe.c,v 1.6 1999/12/01 00:08:36 hobbs Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.7 1999/12/12 02:27:20 hobbs Exp $ */ #include "tclInt.h" @@ -353,7 +353,7 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile, } /* - * We need to allocate and convert this before the (v)fork + * We need to allocate and convert this before the fork * so it is properly deallocated later */ dsArray = (Tcl_DString *) ckalloc(argc * sizeof(Tcl_DString)); @@ -364,7 +364,7 @@ TclpCreateProcess(interp, argc, argv, inputFile, outputFile, errorFile, } joinThisError = (errorFile == outputFile); - pid = vfork(); + pid = fork(); if (pid == 0) { fd = GetFd(errPipeOut); |