AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20070406112351.1f90ad03@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<maxim.kozlovsky@onstor.com>,<larry.scheer@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E032A6E42@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 6 Apr 2007 11:24:16 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>
Cc: "Larry Scheer" <larry.scheer@onstor.com>
Subject: Re: how to find the source
Message-ID: <20070406112416.32337b1b@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E032A6E42@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E032A6E42@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Fri, 6 Apr 2007 11:15:26 -0700 "Maxim Kozlovsky"
<maxim.kozlovsky@onstor.com> wrote:

> What is the general algorithm for getting the source of some linux
> library function or utility? In the current case, I want to look at
> the source for getopt(), how would I find out which package it
> belongs to and what is the command to get the source for it?

Eventually, Larry will have the source for everything we use checked
into the branch, but in the meantime you can use the apt-get source
command:

getopt is standard C library, so you would get the source for glibc.  i
believe the command would be

apt-get source libc6

In general, you have to know what package/library that function is in,
sometimes determinable from the man page, and get the source for that
package with apt-get source command.