内核空间中有 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

最低0.47元/天 解锁文章
1722

被折叠的 条评论
为什么被折叠?



