reproducers.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:clusterfuzz-tools 作者: google 项目源码 文件源码
def get_process_ids(self, process_id, recursive=True):
    """Return list of pids for a process and its descendants."""

    # Try to find the running process.
    if not psutil.pid_exists(process_id):
      return []

    pids = [process_id]
    try:
      psutil_handle = psutil.Process(process_id)
      children = psutil_handle.children(recursive=recursive)
      for child in children:
        pids.append(child.pid)
    except:
      logger.info('psutil: Process abruptly ended.')
      raise

    return pids
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号