使用 Clion 查看 DRBD(Kernel Module)代码

因为内核里有很多编译参数,所以需要配置下。 可以参考 http://ybin.cc/tools/clion-for-linux-driver-developer/ 我的最终配置是: … include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/include) include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/include/linux) include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/mm) include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/arch/x86/include) include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/include/uapi) include_directories(../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/arch/x86/include/uapi) include_directories(.) include_directories(drbd) include_directories(drbd/compat) include_directories(drbd/linux) add_definitions(-imacros ../kernel-3.10.0-327.36.1.el7/linux-3.10.0-327.36.1.el7/include/linux/kconfig.h) add_definitions(-D__KERNEL__) add_definitions(-DKBUILD_MODNAME) add_definitions(-DCONFIG_BLOCK) add_definitions(-DCONFIG_HZ) add_definitions(-DMODULE) add_definitions(-std=gnu89) …

Glibc 的 Bug

最近恰好碰到,查了下确实是 glibc 的 bug: https://bugzilla.redhat.com/show_bug.cgi?id=1374239 这里还给了一个在 Python 中的解决方法(work around):https://bugs.sugarlabs.org/ticket/1940