X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <9e0cf0bf0803182346w4c5332fbp444e4db8f8c185a2@mail.gmail.com>
Date: Wed, 19 Mar 2008 08:46:32 +0200
From: "Alon Bar-Lev" <alon.barlev@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Strange pthread_atfork() behavior
In-Reply-To: <200803172248.47653.alon.barlev@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <200803172248.47653.alon.barlev@gmail.com>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hello,

Can anyone test this and see if it behaves differently?
I use latest stable cygwin and Windows 2003.

Thanks,
Alon.

On 3/17/08, Alon Bar-Lev <alon.barlev@gmail.com> wrote:
>
>  Hello,
>
>  Please CC my as I am not subscribed.
>
>  Just notice a difference between Linux and cygwin, hope
>  someone will be able to figure it out.
>
>  When running this program on Linux I get expected behavior.
>
>  When running under cygwin the exec program runs after about 60 seconds.
>  The following is the output:
>
>  __atfork_prepare
>  __atfork_parent
>  before sleep
>  __atfork_child
>  after sleep
>  <parent is not running anymore>
>  <wait about 60 seconds>
>       56 [main] a 2952 sig_send: wait for sig_complete event failed, signal -34, rc 258, Win32 error 0 at child
>  <child output>
>
>  Any clue?
>
>  Regards,
>  Alon Bar-Lev.
>
>  ---
>
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <pthread.h>
>
>  static void __atfork_prepare  (void) {printf ("__atfork_prepare\n");}
>  static void __atfork_parent (void) {printf ("__atfork_parent\n");}
>  static void __atfork_child (void) {printf ("__atfork_child\n");}
>
>  int main (void) {
>         pthread_atfork (__atfork_prepare, __atfork_parent, __atfork_child);
>
>         if (fork () == 0) {
>                 printf ("at child\n");
>                 execl ("/bin/ls", "/bin/ls", NULL);
>         }
>
>         printf ("before sleep\n");
>         sleep (10);
>         printf ("after sleep\n");
>  }
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

