Hirdetés

Új hozzászólás Aktív témák

  • Jester01

    veterán

    válasz Gyuri16 #1680 üzenetére

    man waitpid

    POSIX.1-2001 specifies that if the disposition of SIGCHLD is set to SIG_IGN or the SA_NOCLDWAIT flag is set for
    SIGCHLD (see sigaction(2)), then children that terminate do not become zombies and a call to wait() or waitpid() will
    block until all children have terminated, and then fail with errno set to ECHILD. (The original POSIX standard left
    the behavior of setting SIGCHLD to SIG_IGN unspecified. Note that even though the default disposition of SIGCHLD is
    "ignore", explicitly setting the disposition to SIG_IGN results in different treatment of zombie process children.)

    Tehát a 2001-es POSIX szabvány szerint a signal miatt nem lesznek zombik, a waitpid pedig az összes gyereket bevárja és aztán hibát dob (vagyis nem adja vissza a status-t). Más szabványú implementáció esetén még a signal ellenére is szükséges lehet a waitpid a zombik elkerülésére.

    Jester

Új hozzászólás Aktív témák