dll call and fork

Stephane Corbe sc@axlog.fr
Wed Mar 13 08:24:00 GMT 2002


Hello,

    If I fork my programm,
    the child died when it call a function in a DLL. (Cygwin 1.3.10-1 on
NT4)

void dll_call(int i)
{
     printf("in dll_call %d\n", i);
 }

...

   printf("begin");
   switch (pid=fork())
   {
        case 0 :
            printf("child is alive\n");
            dll_call(pid);
            printf("after dll_call\n");
            break;

        case -1 :
            printf ("fork error\n");
            break;

        default:
            printf ("parent is alive\n");
            dll_call(pid);
            while (1);  // or sleep; gets, ... same result
    }


Output is :

begin
child_is_alive
parent is alive
in dll_call 0
/* nothing else */


Did you see this before ?

    Stephane




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list