def METHOD_NAME(tag):
    logging.debug("%s: waitid for exiting processes", tag)
    idobj = os.waitid(os.P_ALL, 0, os.WEXITED)
    pid = idobj.si_pid
    status = idobj.si_status
    if pid == child_pid:
        exit_with_status(pid, status)
    else:
        logging.debug("%s: reaped zombie pid %s with status %s", tag, pid, status)