Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find source code of ldconfig? [closed]

I want to peek into its implementation,where is it available?

like image 876
gdb Avatar asked Apr 12 '11 10:04

gdb


2 Answers

ldconfig is the part of glibc library.

like image 68
maverik Avatar answered Sep 29 '22 07:09

maverik


Here is how I found out where the source code is, on my system which runs the Fedora distribution of Linux. (For Debian, Ubuntu and similar distributions the command(s) to use would be different.)

rpm -qfi `which ldconfig`

(those `s are backticks, not apostrophes.)

This outputs the following

Name        : glibc                        Relocations: (not relocatable)
Version     : 2.13                              Vendor: Fedora Project
Release     : 1                             Build Date: Thu 20 Jan 2011 10:52:15 AM GMT
Install Date: Sun 13 Mar 2011 11:42:50 AM GMT      Build Host: x86-04.phx2.fedoraproject.org
Group       : System Environment/Libraries   Source RPM: glibc-2.13-1.src.rpm
Size        : 13616282                         License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
Signature   : RSA/SHA256, Thu 20 Jan 2011 04:42:22 PM GMT, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.gnu.org/software/glibc/
Summary     : The GNU libc libraries
Description :
The glibc package contains standard libraries which are used by
multiple programs on the system. In order to save disk space and
memory, as well as to make upgrading easier, common system code is
kept in one place and shared between programs. This particular package
contains the most important sets of shared libraries: the standard C
library and the standard math library. Without these two libraries, a
Linux system will not function.

The important part of this output is the Source RPM field. This shows that ldconfig is part of the glibc project (at least, according to Fedora - very occassionally some distros package two closely-related source projects in one package, but that's rare).

So hopefully you should find the source of ldconfig in this tarball: http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.gz

In the unlikely event that it isn't there, you should be able to find it in the source rpm for glibc for the Fedora distribution (or the equivalent source package for your distribution).

like image 28
Robin Green Avatar answered Sep 29 '22 08:09

Robin Green