[717] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

A small patch

daemon@ATHENA.MIT.EDU (Mark Evans)
Thu Sep 4 18:54:45 1997

Date: Thu, 04 Sep 1997 16:33:57 -0600
From: Mark Evans <mevans@cti-ltd.com>
To: pthreads mailing list <pthreads@MIT.EDU>

This is a multi-part message in MIME format.
--------------6792A640FD894D1F7848A20D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Attached is a small patch to fix two problems:

  1. The wrapper for vfork() wasn't getting built.
  2. fcntl() essentially ignored F_SETFD commands, preventing programs
     from setting a file descriptors "close on exec" flag.

--
 Mark Evans                            Where do I want to go?
 Conservation Through Innovation Ltd.  [Linux! <http://www.linux.org>]



--------------6792A640FD894D1F7848A20D
Content-Type: text/plain; charset=us-ascii; name="pthreads-1_60_beta6-fork.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="pthreads-1_60_beta6-fork.patch"

diff -c -r pthreads-1_60_beta6-orig/pthreads/fd.c pthreads-1_60_beta6/pthreads/fd.c
*** pthreads-1_60_beta6-orig/pthreads/fd.c	Sat Mar 15 14:50:16 1997
--- pthreads-1_60_beta6/pthreads/fd.c	Thu Sep  4 15:55:57 1997
***************
*** 842,851 ****
--- 842,857 ----
  			ret = fd_allocate();
  			fd_basic_dup(va_arg(ap, int), ret);
  			break;
+ /* Commented out to use the default case which will simply pass-through
+  * this call to the "real" fcntl().  According to POSIX Std 1003.1b-1993,
+  * F_SETFD/F_GETFD only effect the FD_CLOEXEC flag.  This seems harmless
+  * to me since it only effects the fd after an exec.
  		case F_SETFD:
  			break;
  		case F_GETFD:
  			break;
+  * (mevans)
+  */
  		case F_GETFL:
  			ret = fd_table[fd]->flags;
  			break;
diff -c -r pthreads-1_60_beta6-orig/pthreads/process.c pthreads-1_60_beta6/pthreads/process.c
*** pthreads-1_60_beta6-orig/pthreads/process.c	Sat Mar 15 14:50:16 1997
--- pthreads-1_60_beta6/pthreads/process.c	Thu Sep  4 15:47:35 1997
***************
*** 39,44 ****
--- 39,45 ----
  #include <pthread.h>
  #include <stdarg.h>
  #include <unistd.h>
+ #include <config.h>     /* So HAVE_VFORK is correct (mevans) */
  
  #ifndef lint
  static const char rcsid[] = "$Id: process.c,v 1.53.4.1 1996/11/12 13:45:16 proven Exp $";

--------------6792A640FD894D1F7848A20D--


home help back first fref pref prev next nref lref last post