Waitpid for child process does not succeed

I start the process using execvand letting it write to a file. I run a thread at the same time that controls the file so that its size does not exceed a certain limit using stat.st_size. Now that the limit is hit, I am waitpidfor a child process, but this causes an error, and the process that I run in the background becomes a zombie. When I make a stop using the same waitpidfrom the main thread, the process kills without becoming a zombie. Any ideas?

Edit: errnoequal to 10 and waitpidreturns -1. It is on a Linux platform.

+1
source share
1 answer

, errno 10 ECHILD.

man :

ECHILD ( waitpid() waitid()) , pid (waitpid()) idtype id (waitid()), . ( , SIGCHLD SIG_IGN. . Linux Notes .)

, pid, , , waitpid() ( , , , ).

:

  • " , SIGCHLD SIG_IGN" - SIGCHLD SIG_IGN, wait , waitpid , ( ).

  • ". Linux Notes ." - Linux - . linux ( , - ). Linux 2.4, . . __WNOTHREAD.

, - , , " , ".

+1

All Articles