Kernel - 内核同libc的关系

内核空间中有 libc 吗?我的意思是,你必须根据某个 libc 来构建内核,对吗?那么内核空间中是否有一个 libc(可能是静态链接的)?

如果有,这与用户态的 glibc 有什么关系? 它们必须是相同的版本吗?

Is there a libc in kernel space? I mean you have to build kernel against some libc right? So Is there a libc (probably statically-linked) sitting within kernel space?

If yes, how is this related to userland glibc? Must they be the same version?

内核空间实际上没有 libc。libc 是用户空间库,不能在内核空间使用。

但 libc 中几乎所有对内核空间有意义的函数都被移植到了内核空间。你通常可以在 include/linux/ 中找到头文件。

据我所知,这两种实现并不共享代码库。

There is actually no libc in kernel space. Libc is user-space library, and you can't use it from kernel-space.

But almost all functions from libc that make sense in kernel space are ported. You can find headers in include/linux/ usually.

As far as I know these two implementations don't share codebase.

libc 中的一些可用函数是在内核代码中实现的,例如,有一个 p

安装IB网卡驱动的时候报错Failed to install mlnx-ofed-kernel-dkms DEB Collecting debug info... See /tmp/MLNX_OFED_LINUX.10124.logs/mlnx-ofed-kernel-dkms.debinstall.log ubuntu@ubuntu-System-Product-Name:~/Downloads/MLNX_OFED_LINUX-4.9-7.1.0.0-ubuntu20.04-x86_64$ sudo cat /tmp/MLNX_OFED_LINUX.10124.logs/mlnx-ofed-kernel-dkms.debinstall.log /usr/bin/dpkg -i --force-confnew --force-confmiss /home/ubuntu/Downloads/MLNX_OFED_LINUX-4.9-7.1.0.0-ubuntu20.04-x86_64/DEBS/MLNX_LIBS/mlnx-ofed-kernel-dkms_4.9-OFED.4.9.7.1.0.1_all.deb Selecting previously unselected package mlnx-ofed-kernel-dkms. (Reading database ... 193000 files and directories currently installed.) Preparing to unpack .../mlnx-ofed-kernel-dkms_4.9-OFED.4.9.7.1.0.1_all.deb ... Unpacking mlnx-ofed-kernel-dkms (4.9-OFED.4.9.7.1.0.1) ... Setting up mlnx-ofed-kernel-dkms (4.9-OFED.4.9.7.1.0.1) ... Loading new mlnx-ofed-kernel-4.9 DKMS files... First Installation: checking all kernels... Building only for 5.15.0-139-generic Building for architecture x86_64 Building initial module for 5.15.0-139-generic ERROR (dkms apport): unable to determine source package for mlnx-ofed-kernel-dkms Error! Bad return status for module build on kernel: 5.15.0-139-generic (x86_64) Consult /var/lib/dkms/mlnx-ofed-kernel/4.9/build/make.log for more information. dpkg: error processing package mlnx-ofed-kernel-dkms (--install): installed mlnx-ofed-kernel-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: mlnx-ofed-kernel-dkms
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值