libc 源代码位置 - 用于下载或在线查看?
抱歉,我知道这很愚蠢,但是 linux libc 源代码在哪里可用?我从 GNU 下载的似乎不是我想要的,特别是我在 pthreads 函数系列中找不到任何东西。
某处有在线(超文本交叉引用)版本吗?
Sorry I know this is stupid but where is linux libc source code available? What I downloaded from GNU didn't seem to be what I wanted, specifically I could find nothing in the pthreads function family.
Is there an online (hypertexted cross-referenced) version somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
大多数 Linux 使用名为
glibc
的 libc 版本。glibc 的 LXR(在线交叉引用系统)例如
这里 http://koala .cs.pub.ro/lxr/glibc/ 2.9 版本(链接已损坏)。我必须说,有些东西可能没有被 lxr'ed,因为某些源是在构建过程中生成的,例如 - 据我记得 - 系统调用的包装器。Pthreads 位于 nptl/ 文件夹中。 libc 源代码的正确链接是 http://ftp.gnu.org/gnu /glibc/glibc-2.14.tar.bz2(或将2.14更改为您的版本)
更新:关闭koala的lxr后,有:
带有 glibc 的 Metager:http://code.metager.de/ source/xref/gnu/glibc/(与 Sun 的 OpenGrok 一起使用,最初用于为 Solaris/OpenSolaris 生成在线 x-ref)Google 代码搜索(我知道它已关闭;但我也知道它是其他版本) :
http://code.google.com/codesearch 并尝试搜索 glibc 特定的内容< /s>UPD(2013 年 3 月)他们再次杀死了 codesearch:
UPD 2017
带有 glibc 的 Metager:http://code.metager。 de/source/xref/gnu/glibc/有 glibc 作者的在线 git:https://sourceware.org/git/?p=glibc.git (树可在 https://sourceware.org/git/?p=glibc.git;a=tree)
Glibc git 是镜像到github(有一些搜索功能) https://github.com/bminor/glibc Buildroot 2018.05 特别使用这个镜像。
所有 debian 软件包中都有类似 google 的 codesearch 的搜索:https://codesearch.debian.net/ 。它可以通过“package:glibc request”请求搜索 glibc 源代码,并且还具有文件浏览器: http:// resources.debian.net/src/glibc/
Most linuxes use a libc version named
glibc
.The LXR (online cross-reference system) for glibc is e.g.
here http://koala.cs.pub.ro/lxr/glibc/ for 2.9 version(link is broken). I must say that something may be not lxr'ed because some sources are generated in the build process, for example - as i can remember - wrappers around a system calls.Pthreads are in
nptl/
folder. Right link to libc sources is http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.bz2 (or change 2.14 to your version)Update: After closing of koala's lxr, there are:
Metager with glibc: http://code.metager.de/source/xref/gnu/glibc/(Served with Sun's OpenGrok, which was originally used to generate online x-ref for Solaris/OpenSolaris)Google code search (I know that it was closed; but I also know it's other version which is up):
http://code.google.com/codesearch and try to search something glibc-specificUPD (march 2013) They killed codesearch again:
UPD 2017
Metager with glibc: http://code.metager.de/source/xref/gnu/glibc/There is online git by glibc authors: https://sourceware.org/git/?p=glibc.git (tree is browserable at https://sourceware.org/git/?p=glibc.git;a=tree)
Glibc git is mirrored to github (which has some searching functions) https://github.com/bminor/glibc Buildroot 2018.05 notably uses this mirror.
There is search like google's codesearch in all debian packages: https://codesearch.debian.net/. It can search in glibc sources by "package:glibc request" request and also have file browser: http://sources.debian.net/src/glibc/
有关 glibc 存储库的信息:http://sourceware.org/glibc/wiki/GlibcGit
克隆它以获取您自己的副本并按照您喜欢的方式搜索它:
我将其加载到 IDE 项目中(使用任何首选的 IDE),代码导航效果很好,可以让我找到我感兴趣的内容。
在线浏览源代码 http://sourceware.org/git/?p=glibc.git
Info on the glibc repository: http://sourceware.org/glibc/wiki/GlibcGit
Clone it to get your own copy and search it however you like:
I load it up in an IDE project (using whatever preferred IDE) and the code navigation works quite well to let me find what I'm interested in.
Browse the source online http://sourceware.org/git/?p=glibc.git
如果您使用的是 Debian 派生系统,则可以使用 apt-get source libc6。这将在您当前的工作目录中解压一个
eglibc-2.12.1
目录(当然版本号可能不同),pthreads 支持位于下面的nptl/
目录中那。linuxthreads/
适用于较旧的线程风格,如果您是考古学家的话。If you're on a Debian-derived system, you can use
apt-get source libc6
. This will unpack aeglibc-2.12.1
directory (version number might differ, of course) in your current working directory, and the pthreads support are in thenptl/
directory below that.linuxthreads/
is for the older threading style, in case you're an archaeologist.尝试FreeBSD 和 Linux 内核交叉参考。
玩得开心 :)
Try the FreeBSD and Linux Kernel Cross-Reference.
Have fun :)