def METHOD_NAME():
    # First check if seccomp has a chance of working.
    try:
        libc.prctl(libc.PR_GET_SECCOMP, 0, 0, 0, 0)
    except OSError as e:
        logging.warning(
            "Seccomp is not available, container isolation is degraded (%s).",
            os.strerror(e.errno),
        )
        return False
    try:
        libc.prctl(libc.PR_SET_SECCOMP, _SECCOMP_MODE_FILTER, 0, 0, 0)
    except OSError as e:
        # EFAULT is expected if passing null pointer as filter argument
        if e.errno != errno.EFAULT:
            logging.warning(
                "Unexpected failure when enabling seccomp filter, "
                "container isolation is degraded (%s).",
                e,
            )
            return False
    else:
        logging.warning(
            "Unexpected failure when enabling seccomp filter, "
            "container isolation is degraded."
        )
        return False
    # Load library with utility functions.
    global _lib
    try:
        # Allow overriding library lookup for cases like NixOS
        libseccomp = os.environ.get("LIBSECCOMP", "libseccomp.so.2")
        _lib = ctypes.CDLL(libseccomp, use_errno=True)
    except OSError as e:
        logging.warning(
            "Could not load libseccomp2, "
            "please install it for improved container isolation (%s).",
            e,
        )
        return False
    _lib.seccomp_init.argtypes = [c_uint32]
    _lib.seccomp_init.restype = _scmp_filter_ctx
    _lib.seccomp_init.errcheck = _check_null
    _lib.seccomp_release.argtypes = [_scmp_filter_ctx]
    _lib.seccomp_release.restype = None
    _lib.seccomp_export_pfc.argtypes = [_scmp_filter_ctx, c_int]
    _lib.seccomp_export_pfc.errcheck = _check_errno
    _lib.seccomp_load.argtypes = [_scmp_filter_ctx]
    _lib.seccomp_load.errcheck = _check_errno
    _lib.seccomp_arch_resolve_name.argtypes = [c_char_p]
    _lib.seccomp_arch_resolve_name.restype = c_uint32
    _lib.seccomp_arch_add.argtypes = [_scmp_filter_ctx, c_uint32]
    _lib.seccomp_arch_add.errcheck = _check_errno
    _lib.seccomp_syscall_resolve_name.argtypes = [c_char_p]
    _lib.seccomp_syscall_resolve_name.restype = c_int
    _lib.seccomp_rule_add.argtypes = [_scmp_filter_ctx, c_uint32, c_int, c_uint]
    _lib.seccomp_rule_add.errcheck = _check_errno
    return True