kill(getpid(), SIGCHLD);
این خط رو فراموش کنید . روی کد شما که کار می کردم توی یکی از مراحل تست این خط رو اضافه کردم ولی کار نکرد و آخر سر باید حذفش می کردم ولی یادم رفت . عذر می خوام .
این ها رو از توی ویکی پدیا کپی کردم .
On Unix and Unix-like computer operating systems, a
zombie process or defunct process is
a process that has completed execution but still has an entry in the process table.
This entry is still needed to allow the parent process to
read its child's exit status.
و این یکی
To remove zombies from a system, the SIGCHLD signal can be sent to the parent
manually, using the kill command. If the parent process still refuses to reap
the zombie, the next step would be to remove the parent process. When a process
loses its parent, init becomes its new parent. init periodically executes the
wait system call to reap any zombies with init as parent.To remove zombies from
a system, the SIGCHLD signal can be sent to the parent manually, using the
kill command. If the parent process still refuses to reap the zombie,
the next step would be to remove the parent process. When a process
loses its parent, init becomes its new parent. init
periodically executes the wait system call to reap any zombies with init as parent.
کل مطلب :
http://en.wikipedia.org/wiki/Zombie_process