Hallo, Am Dienstag, 30. Dezember 2003 00:10 schrieb Gerald Goebel:
solang der kid läuft gibt waitpid 0 zurück. ist kid aber beendet, gibt waitpid die pid des beendeten kid zurück.
In perldoc -f waitpid steht bei am Anfang das: waitpid PID,FLAGS Waits for a particular child process to terminate and returns the pid of the deceased process, or "-1" if there is no such child process. On some systems, a value of 0 indicates that there are processes still running. Da steht "on some systems". Wäre dann nicht "unless ($kid > 0 or $kid < 0)" besser als "if ($kid == 0)" ? Oder geben andere Systeme dann trotzdem einen Wert zurück und es würde auch ein Fehler im Programm sein? Oder wie müsste man das dann formulieren? Oder ist es zu schwer so ein System anzutreffen, als dass es sich lohnen würde? Ferdinand