This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dll call and fork


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]