Hi all:
......
if((pid = fork()<0)
{
printf("fork error!.\n");
exit(-1);
}
A: printf("pid=%d.\n",pid);
if(pid>0){...........}
if(pid<0){............}
when I debug it in gdb,set breakpoint at A,then run;after it print the value
of pid,the pid is larger 0(assume it is 1001),so it is the child process's
ID;
I have thought the pid should be 0 after I do :
gdb>attach 1001
but the pid was not changed.
what is wrong.
can anybody give help for me?
thx !
regards
zhou