Obtaining glibc code can be done via apt-get command. Here's basic process done in terminal, which takes no longer than 5 mins:

  1. Create glibc-source directory with mkdir glibc-source and cd glibc-source
  2. run apt-get source glibc
  3. Once apt-get is done, you'll have 3 files and one directory, glibc-2.23/, glibc_2.23-0ubuntu3.dsc, glibc_2.23-0ubuntu3.debian.tar.xz, glibc_2.23.orig.tar.xz. The file you want is glibc-2.23/stdlib/atoi.c
Answer from Sergiy Kolodyazhnyy on askubuntu.com
🌐
GitHub
github.com › bminor › glibc
GitHub - bminor/glibc: Unofficial mirror of sourceware glibc repository. · GitHub
Please see https://www.gnu.org... This web page gives detailed information on how to report bugs properly. The GNU C Library is free software....
Starred by 1.9K users
Forked by 469 users
Languages   C 71.0% | Assembly 12.4% | C++ 7.2% | Pawn 6.0% | Makefile 1.1% | Python 1.0%
🌐
Internet Archive
archive.org › software
glibc-2.28 source code : Free Download, Borrow, and Streaming : Internet Archive
glibc-2.28 · Scanner · Internet Archive HTML5 Uploader 1.6.3 · 579 Views · download 1 file GZIP download · download 1 file TORRENT download · download 5 Files download 5 Original SHOW ALL · Game Source Code: Miscellaneous Game Source Code Collection Software History Collection ·
🌐
Internet Archive
archive.org › software
glibc-2.35 source code : GNU project : Free Download, Borrow, and Streaming : Internet Archive
https://sourceware.org/git/glibc.git · Scanner · Internet Archive HTML5 Uploader 1.6.4 · Website · https://www.gnu.org/software/libc/ 240 Views · 1 Favorite · download 1 file GZIP download · download 1 file TORRENT download · download 5 Files download 5 Original SHOW ALL · Game Source Code: Miscellaneous Game Source Code Collection Software History Collection ·
🌐
GNU
gnu.org › software › libc › sources.html
The GNU C Library - GNU Project - Free Software Foundation
The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
🌐
GitHub
github.com › lattera › glibc
GitHub - lattera/glibc: GNU Libc - Extremely old repo used for research purposes years ago. Please do not rely on this repo. · GitHub
Please see http://www.gnu.org/... This web page gives detailed information on how to report bugs properly. The GNU C Library is free software....
Starred by 2K users
Forked by 962 users
Languages   C 65.8% | Assembly 14.2% | C++ 9.4% | Objective-C 4.4% | Roff 3.4% | Makefile 0.8%
🌐
Launchpad
code.launchpad.net › glibc
Git : Code : GLibC
This repository is an import of the Git repository at git://sourceware.org/git/glibc.git. The next import is scheduled to run in 44 minutes. Last successful import was 5 hours ago. Import started 5 hours ago on juju-98ee42-prod-launchpad-codeimport-18 and finished 5 hours ago taking 5 minutes ...
Find elsewhere
🌐
GNU
sourceware.org › glibc › sources.html
The GNU C Library (glibc)
Releases are available by source branch checkout (gitweb) and tarball via ftp. ... Release tarballs are available via anonymous ftp at https://ftp.gnu.org/gnu/glibc/ and its mirrors.
🌐
Ask Ubuntu
askubuntu.com › questions › 696139 › how-can-i-get-glibc-source-code
system installation - How can i get glibc source code ? - Ask Ubuntu
i have download one source code (glibc,linuxthreads) form GNU site .and install it in /usr/local. I want to compiler glibc and change some code ,but i don't know where can download the source code.
Top answer
1 of 4
27

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:

  1. 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)

  2. 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-specific

UPD (march 2013) They killed codesearch again:

404. That’s an error.

The requested URL /codesearch was not found on this server. That’s all we know.

UPD 2017

  1. Metager with glibc: http://code.metager.de/source/xref/gnu/glibc/

  2. 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)

  3. Glibc git is mirrored to github (which has some searching functions) https://github.com/bminor/glibc Buildroot 2018.05 notably uses this mirror.

  4. 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/

2 of 4
15

Info on the glibc repository: http://sourceware.org/glibc/wiki/GlibcGit

Clone it to get your own copy and search it however you like:

git clone git://sourceware.org/git/glibc.git

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

🌐
Open Hub
openhub.net › p › glibc
The GNU C Library Open Source Project on Open Hub
Analyzed about 7 hours ago. based on code collected 1 day ago. The GNU C Library, glibc, provides the standard C library interface for GNU/Linux and other Free Software operating systems.
🌐
GitHub
github.com › bminor › glibc › blob › master › malloc › malloc.c
glibc/malloc/malloc.c at master · bminor/glibc
This is a version (aka ptmalloc2) of malloc/free/realloc written by · Doug Lea and adapted to multiple threads/arenas by Wolfram Gloger. · There have been substantial changes made after the integration into · glibc in all parts of the code. Do not look for much commonality ·
Author   bminor
🌐
GNU
sourceware.org › glibc
The GNU C Library (glibc)
You can contact the developer community by emailing the developer list libc-alpha@sourceware.org. The GNU C Library releases every 6 months. See the NEWS file in the glibc sources for more information.
🌐
GitHub
github.com › oracle › glibc
GitHub - oracle/glibc: Unofficial mirror of http://sourceware.org/git/glibc.git · GitHub
This repository contains the source code of Oracle Linux (OL) glibc RPMs for each OL glibc release and update, in a source tree format. The content is obtained by applying the OL glibc RPM patches to the OL glibc RPM source tarball.
Author   oracle
🌐
Gentoo Forums
forums.gentoo.org › board index › assistance › portage & programming
how to find glibc sorce code - Gentoo Forums
October 27, 2019 - Sources will be downloaded if they are needed. Regards, NeddySeagoon Computer users fall into two groups:- those that do backups those that have never had a hard drive fail. ... nick_gentoo wrote:The C++ standard library code is directly in gcc, I think... Yes, it is in library libstdc++, which is provided by GCC. Code can also be viewed here: https://gcc.gnu.org/git/?p=gcc.git