What about something idiotic like this: junk = fork(); if (junk < 0) { // error } else if (junk > 0) { // parent comes here printf("Child pid = %d\n, junk); } else { // junk = 0; chil comes here sleep(5); // sleep 5 seconds here ... }
You could stick a getch() into the child instead of a sleep - depends on what you are doing with the keyboard. DAF Gold Edward wrote: > ddd is a graphic front end for gdb (and dbx and other debuggers). > However, I haven't been able to redirect it to the child process, > after a fork call. I need to redirect the debugger before the > childs birth-- see the reason below . > I've write "set follow fork-mode child" on the gdb panel of ddd, > and also tried it through the ddd graphical means. > Still, the debugger remains attached to the parent child. > Someone know how to attach the gdb to the child process- BEFORE > it's birth? > (The child process dies soon after it's birth-- because of an access > violation...). > > > Thanks > Edy > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] > > > ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]