vwoptimize.py 文件源码

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

项目:vwoptimize 作者: denik 项目源码 文件源码
def die_if_parent_dies(signum=9):
    if 'linux' not in sys.platform:
        return
    try:
        import ctypes
        libc = ctypes.CDLL('libc.so.6', use_errno=True)
        PR_SET_PDEATHSIG = 1
        result = libc.prctl(PR_SET_PDEATHSIG, signum)
        if result == 0:
            return True
        else:
            log('prctl failed: %s', os.strerror(ctypes.get_errno()))
    except StandardError, ex:
        sys.stderr.write(str(ex) + '\n')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号