473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Browsing C library in Linux

Hi,

I know that it is impossible to browse through
the source code of C library in Linux. But I do not remember
how. In short, I would like to see the implementation
of standard header files such as <string.hetc.

I use Ubuntu. I've even downloaded the linux-headers.
I can see only asm code in /usr/src/linux/include/asm-i386.
Any pointers/help appreciated.
Thanks,
MC
--------------------------------------------------
All in all I'm just another brick in the FIREWALL.

Jan 14 '08 #1
10 2024
Madhusudhanan Chandrasekaran <mc**@cse.buffalo.eduwrote:
Hi,

I know that it is impossible to browse through
the source code of C library in Linux. But I do not remember
how. In short, I would like to see the implementation
of standard header files such as <string.hetc.

I use Ubuntu. I've even downloaded the linux-headers.
I can see only asm code in /usr/src/linux/include/asm-i386.
Any pointers/help appreciated.
This is off-topic in this group, almost akin to asking where the nearest
petrol station is to your home.

In any event, on most Ubnutu and Debian-derived system, you can
automagically download and unpack the source (into your $CWD) using
incantions similar to:

$ apt-get source glibc

(You may need to `apt-get install dpkg-dev`, first; if you ask in a proper
group people might be quicker to correct me if I prove wrong.)

glibc suffers from a large, complex, and in places nearly impenetrable code
base. You might want to study the string implementation here before diving
into glibc's optimized assembly and C code:

http://www.openbsd.org/cgi-bin/cvswe...b/libc/string/
Jan 14 '08 #2
Madhusudhanan Chandrasekaran wrote:
Hi,

I know that it is impossible to browse through
the source code of C library in Linux. But I do not remember
how.
That's easy. Just don't do it.

But in case you made the reverse mistake of those that use the word
"flammable" when in fact they mean "inflammable":
In short, I would like to see the implementation
of standard header files such as <string.hetc.
If you want to see the implementation of the header, just look in
/usr/include. If you want to see how the library itself is implemented, just
download the glibc sources and inspect those.
I use Ubuntu. I've even downloaded the linux-headers.
Those are just for the linux kernel API and have nothing to do with the
Standard library.
I can see only asm code in [...]
You'll find that siginificant portions of the C library are implemented in
assembler. You'll also find the C source quite illegible.

robert
Jan 14 '08 #3
Robert Latest wrote:
>
>In short, I would like to see the implementation
of standard header files such as <string.hetc.

If you want to see the implementation of the header, just look in
/usr/include. If you want to see how the library itself is implemented, just
download the glibc sources and inspect those.
Those were the old times Robert. When you would just look in the
include directory. This days, software bloat makes that impossible
since the system compiler stores the *real* includes under
/usr/lib/gcc... and a VERY long path. That path is of course not
fixed and changes from version to version so that you can
install 26 different gcc compilers in your machine, each with its own
headers, whatever.

I think you can obtain that path with
gcc -v
then look where the includes are but I am not so sure.

This trend started long ago, when "ld" was replaced with
"collect2" (a script), then continued with the linker
calling the C compiler to compile code generated while linking,
then it continued by transforming some libraries from binaries to
some sort of linker scripts (and retaining the .a suffix)
and all kind of hacks that are thrown upon the older hacks until
only a few selected people in the world really understand
what is going on under the hood.

And this worrisome trend goes on with everything else under
linux, software quality goes down the drain...

VISTA of course is much better :-)

There, the bloat is so big that the linux hacks are ridiculous in
comparison.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jan 14 '08 #4
jacob navia <ja***@nospam.comwrites:
Robert Latest wrote:
>>
>>In short, I would like to see the implementation
of standard header files such as <string.hetc.

If you want to see the implementation of the header, just look in
/usr/include.

Those were the old times Robert. When you would just look in the
include directory. This days, software bloat makes that impossible
since the system compiler stores the *real* includes under
/usr/lib/gcc... and a VERY long path.
An excellent example of why off-topic posts should be re-directed to a
more suitable news group. I'll limit my answer to say that, at least
in general, you are wrong about this. To find out more re-post this
comment to a group where Linux experts will feel free to comment on it

--
Ben.
Jan 14 '08 #5
Robert Latest wrote:
Madhusudhanan Chandrasekaran wrote:
....
But in case you made the reverse mistake of those that use the word
"flammable" when in fact they mean "inflammable":
That's not a mistake - in conflict with all reasonable expectations,
those two words are in fact synonyms.
<http://en.wiktionary.org/wiki/inflammable>
Jan 14 '08 #6
Madhusudhanan Chandrasekaran wrote:
In short, I would like to see the implementation
of standard header files such as <string.hetc.
Make sure that you do Not immitate
any reserved identifier conventions.

__Don't _start _writing __code _with __leading __underscores!

--
pete
Jan 14 '08 #7
James Kuyper:
Robert Latest wrote:
>Madhusudhanan Chandrasekaran wrote:
...
>But in case you made the reverse mistake of those that use the word
"flammable" when in fact they mean "inflammable":

That's not a mistake - in conflict with all reasonable expectations,
those two words are in fact synonyms.
<http://en.wiktionary.org/wiki/inflammable>

I thought he was being sarcastic.

While we're on the subject of stupidities in English, I was never quite
comfortable with the term "ingenius" or "invaluable".

--
Tomás Ó hÉilidhe
Jan 14 '08 #8
Tomás Ó hÉilidhe wrote:
James Kuyper:
>Robert Latest wrote:
>>Madhusudhanan Chandrasekaran wrote:
...
>>But in case you made the reverse mistake of those that use the word
"flammable" when in fact they mean "inflammable":
That's not a mistake - in conflict with all reasonable expectations,
those two words are in fact synonyms.
<http://en.wiktionary.org/wiki/inflammable>


I thought he was being sarcastic.
The first part of his response sarcastically answered the question as it
was actually worded. The lines cited above were the introduction to the
subsequent section of his response, in which he addressed the question
as the OP presumably intended to write it, with "impossible" corrected
to "possible".

Based upon my personal experience (which is extensive, because my wife
and many of my co-workers are not native speakers of English), I think
Robert Latest was being excessively subtle. It requires considerable
fluency in a language to recognize criticisms written that subtly, and I
suspect that Madhusudhanan lacks that level of fluency - though I may be
making an unjustified assumption based upon his name.
Jan 14 '08 #9
"=?iso-8859-1?q?Tom=E1s_=D3_h=C9ilidhe?=" <to*@lavabit.comwrote:
James Kuyper:
Robert Latest wrote:
Madhusudhanan Chandrasekaran wrote:
...
But in case you made the reverse mistake of those that use the word
"flammable" when in fact they mean "inflammable":
That's not a mistake - in conflict with all reasonable expectations,
those two words are in fact synonyms.
<http://en.wiktionary.org/wiki/inflammable>

I thought he was being sarcastic.

While we're on the subject of stupidities in English, I was never quite
comfortable with the term "ingenius"
Neither am I.

Richard (not being 100% ingenuous)
Jan 15 '08 #10
Robert Latest wrote:
>
.... snip ...
>
But in case you made the reverse mistake of those that use the
word "flammable" when in fact they mean "inflammable":
However those two words have the identical meaning. Really.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Jan 16 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dfenestr8 | last post by:
Earlier I posted asking for a file browsing script, for a GUI app I'd written. Basically, I was after a graphical tool with which I could search for files on my disk, and would return the path of a...
26
by: Dan Nash | last post by:
Hi guys I have a page that is *supposed* to list the directories on the server. Here's the code... folderspec = server.MapPath("./images/") set fso =...
6
by: Ernesto | last post by:
I'm in the process of moving a Python application from Windows to Linux. This means that the drivers for windows ".dll" now must be Linux drivers "shared library file" (.so I think). With...
50
by: Romeo Colacitti | last post by:
Is the C library of most OSes (i.e, unix type OSes) implemented at the very low kernel or just outside kernel level? Looking through the source tree of Linux/BSDs it seems like the C library is...
6
by: Dreamcatcher | last post by:
Hello, I'm trying to learn some C, reading my book, Beginning Linux Programming I came across the following program. The program is supposed to walk through directory's and print all its...
11
by: Eigenvector | last post by:
I apologize if this is a trivial question, but it's always made me wonder when I have to compile my code. There are some #includes that you don't really need to reference in your library and...
21
by: Paul Edwards | last post by:
I would like to port PDPCLIB: http://sourceforge.net/projects/pdos/ my public domain C runtime library for DOS, OS/2, Win32, MVS to Unix now. I am a bit perplexed as to how to do this. ...
4
by: 13gurpreetsingh | last post by:
hi friends, my program demands that we need to list the information in all the files present in a directory ,say xxxx and the files present in all the subdirectories in this xxxx directory. please...
0
by: sebor | last post by:
October 29, 2007 -- The Apache C++ Standard Library project is pleased to announce that the official stdcxx 4.2.0 release is now available for download from the following location:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.