473,385 Members | 1,409 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,385 software developers and data experts.

Best libc implementation

Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi

Oct 6 '06 #1
20 3644
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?
The one that comes with your platform.

Because it's there.

--
Ian Collins.
Oct 6 '06 #2


On Oct 6, 1:45 pm, "int main(void)" <dnu...@gmail.comwrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
I think it's glibc. ;-p

Oct 6 '06 #3
What do you mean by best ?

sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #4
On Thu, 05 Oct 2006 22:45:46 -0700, int main(void) wrote:
Hi all,

What do you people think as the best libc implementation. I'm a newbie,
browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?
If you're a newbie to C and browsing to learn how certain problems are
solved, then definitely stay way from glibc. Not because it's poorly
written, but because it contains many difficult to understand--sometimes
clever, sometimes not--algorithms and data structures, not to mention the
I18N framework, GCC specific bits, and inline assembly. GNU code in
general is often difficult to read.

OpenBSD and NetBSD sport the most straight forward code I've seen. I
suspect FreeBSD and OpenSolaris probably fall in-between.

Then there are alternatives like ulibc and the like, but the old BSD code
has always seemed more intuitive to me.

Note that reading C library implementations isn't necessarily the best way
to introduce yourself to the wide body of C code out there. BSD binutils
might be better. Lua and ICU are significant bodies of code that have most
impressed me, Lua being 100% ISO/ANSI C. libtomcrypt is another well
written C project (all ISO/ANSI, excluding the optional optimized
routines).
Oct 6 '06 #5

raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
When i browsed through some of those open source codes i found ones
implementation (of say strchr) was very much different from the other.
I know that there are some tradeoffs involved.
But i just wanted to know which libc is so much popular among you
guys.
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #6

raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
When i browsed through some of those open source codes i found ones
implementation (of say strchr) was very much different from the other.
I know that there are some tradeoffs involved.
But i just wanted to know which libc is so much popular among you
guys.
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
sorry for dumb question :)
--raxit
int main(void) wrote:
Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
Oct 6 '06 #7
int main(void) wrote:
I want to what is the best libc implementation and why ?
glibc is strong enough that IBM uses it on the BlueGene supercomputer.
Oct 6 '06 #8
William Ahern wrote:
On Thu, 05 Oct 2006 22:45:46 -0700, int main(void) wrote:

>>Hi all,

What do you people think as the best libc implementation. I'm a newbie,
browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?


If you're a newbie to C and browsing to learn how certain problems are
solved, then definitely stay way from glibc. Not because it's poorly
written, but because it contains many difficult to understand--sometimes
clever, sometimes not--algorithms and data structures, not to mention the
I18N framework, GCC specific bits, and inline assembly. GNU code in
general is often difficult to read.

OpenBSD and NetBSD sport the most straight forward code I've seen. I
suspect FreeBSD and OpenSolaris probably fall in-between.
OpenSolaris is very easy to follow, clear and well written with an
excellent source browser:

http://cvs.opensolaris.org/source/

--
Ian Collins.
Oct 6 '06 #9

"int main(void)" <dn****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>
raxitsheth2...@yahoo.co.in wrote:
What do you mean by best ?
Best in terms of speed, code quality etc.
As this post of mine showed, there are _many_ free compilers, most with
their own libc's:
http://groups.google.com/group/comp....ce45991e?hl=en
(I forgot Digital Mars http://www.digitalmars.com/ for the DOS and Windows
targets)

Personally, I like POSIX features whether it is GNU libc or DJ Delorie's
libc he created for DJGPP. This makes them better for porting *NIX
applications. On the other hand, OpenWatcom's libc produces faster code,
but isn't well suited to porting POSIX applications (yet) and many portions
of it aren't easy reading. The library that I found the easiest to read was
Mingw. Supposedly, Digital Mars outperforms them all for the target
platforms that it supports... Also, it is said that TenDRA is the most
pedantic regarding C compliance... (I can't confirm the last two as
truths...)
One more thing i found is,
in libc folder each function is kept in a separate file.
Is there any reason for this ?
I'd like to know too. I suspect it is for ease of maintenance (or perhaps
interfacing with the OS), but I have no proof of that. Personally, I'd
prefer _all_ stdio.h functions to be in stdio.c etc., but I've never seen
any library do it that way, _ever_.
Rod Pemberton
Oct 6 '06 #10
On 5 Oct 2006 22:45:46 -0700, "int main(void)" <dn****@gmail.com>
wrote:
>Hi all,

What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various libc
implementation.
I want to what is the best libc implementation and why ?

Regards,
Yugi
This is just an educated guess, but since it's October, and The
Yankees are in the playoffs, I'd say that Derek Jeter has the best
libc implementation out there. I think he keeps it in his back pocket,
along with a myriad of other things, like chewing tobacco and a
batting glove. You would be well off to contact him about his libc
implementation--if it's anything like I suspect, it is one of the best
for speed and accuracy.

Take care
--
jay
Oct 6 '06 #11
int main(void) <dn****@gmail.comkirjoitti 06.10.2006:
in libc folder each function is kept in a separate file.
Is there any reason for this ?
Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.

Oct 6 '06 #12
Antti-Juhani Kaijanaho wrote:
int main(void) <dn****@gmail.comkirjoitti 06.10.2006:
> in libc folder each function is kept in a separate file.
Is there any reason for this ?


Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.

--
Ian Collins.
Oct 6 '06 #13
Ian Collins <ia******@hotmail.comkirjoitti 06.10.2006:
Antti-Juhani Kaijanaho wrote:
>Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.
The traditional format for Unix static libraries is an ar archive
containing object files.

Oct 6 '06 #14
>Some implementations (for example Unix under static linking) are able to
>avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.
Surely not.

A library is supplied as a single object, individual object files are
not provided.
A library used for static linking on every version of UNIX I have
used (Including UNIX v6, UNIX v7, BSD UNIX 4.1 (Vax), FreeBSD,
System VR4, Microsoft Xenix, etc.) constructs a *.a library out of
a bunch of *.o files with a command like:

ar cv libfoo.a *.o
with or without also running
ranlib libfoo.a

and you can extract the original object files with:

ar xv libfoo.a

Although the linker may object to it, the 'ar' program on many
systems will also tolerate other types of files (like source code),
and in that regard it can often be used as a poor, slow replacement
for tar or cpio (archives created by these are NOT compatible with
each other).

The above does not apply to shared libraries (*.so) which are the
default on the more recent systems.

Oct 6 '06 #15
(previous attributions lost)
Gordon Burditt wrote:
>>>Some implementations (for example Unix under static linking) are able to
avoid linking the unused parts of the library in the executable; these
implementations usually take a compilation unit as the smallest unit of
code that can be left out. Hence, it is beneficial in those
implementations to have as small compilation units in the library as
possible, leading to having a separate compilation unit for each library
function.

Surely not.

A library is supplied as a single object, individual object files are
not provided.


A library used for static linking on every version of UNIX I have
used (Including UNIX v6, UNIX v7, BSD UNIX 4.1 (Vax), FreeBSD,
System VR4, Microsoft Xenix, etc.) constructs a *.a library out of
a bunch of *.o files with a command like:

ar cv libfoo.a *.o
with or without also running
ranlib libfoo.a

and you can extract the original object files with:

ar xv libfoo.a
Ah, it's been a long time since I used ar and ranlib.

Cheers,

--
Ian Collins.
Oct 6 '06 #16
jmcgill <jm*****@email.arizona.eduwrites:
int main(void) wrote:
> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.
That's not surprising; the system runs SuSE Linux (or GNU/Linux if you
prefer).

I think most of the speed-critical code that runs on such a system
isn't dependent on the C standard library anyway; most of it is
probably floating-point computations.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 6 '06 #17
"int main(void)" wrote:
>
What do you people think as the best libc implementation.
I'm a newbie, browsing through the open source codes of various
libc implementation.
I want to what is the best libc implementation and why ?
No such beast. The library is implementation specific.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
Oct 7 '06 #18
Keith Thompson <ks***@mib.orgskriver:
jmcgill <jm*****@email.arizona.eduwrites:
>int main(void) wrote:
>> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.

That's not surprising; the system runs SuSE Linux (or GNU/Linux if you
prefer).

I think most of the speed-critical code that runs on such a system
isn't dependent on the C standard library anyway; most of it is
probably floating-point computations.
I would be suppriced if any code from libc is involved in the
speed-critical parts of any program running on a super-computer. If
speed matters, you tend to work hard you getting the most out of your
code. Buffering is extreamly critical. You can also note that IBM sais
that libc only is used to gain POSIX compliance on there special
kernel. (For computational nodes.) For speed, the linpack and MPI
implenenations are probaly more intressting. (Small changes in LinPack
often moves supercomputers up and down on the top500 list.)

/ Balp
--
http://anders.arnholm.nu/ Keep on Balping
Oct 10 '06 #19
jmcgill wrote:
int main(void) wrote:
> I want to what is the best libc implementation and why ?

glibc is strong enough that IBM uses it on the BlueGene supercomputer.
It has however some of the messiest source code around.

Zealots will have many arguments why it is neccesary to
organize it like they do, none of which convinced me..
Oct 10 '06 #20
=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?= <NO*@Utel.nowrote:
jmcgill wrote:
int main(void) wrote:
I want to what is the best libc implementation and why ?
glibc is strong enough that IBM uses it on the BlueGene supercomputer.

It has however some of the messiest source code around.

Zealots will have many arguments why it is neccesary to
organize it like they do, none of which convinced me..
Hah. It's not necessary; it's merely inevitable. Unfortunately.

Richard
Oct 10 '06 #21

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

Similar topics

6
by: Timo Benk | last post by:
Hi, Is there any info, list or something else regarding non thread safe libc functions somewhere on the web? -timo -- 6832 C8EC -------------------------------- 6FBF 9383...
6
by: Affan Syed | last post by:
I am not able to figure out exactly what this macro is doing. Can one of the gurus around here decipher this? #define sei() __asm__ __volatile__ ("sei" ::) PS: It is from the avr-libc...
25
by: Roger | last post by:
I am writing non GUI software in C for use on Windows and Linux. while libc packages are generally compatible, I am ending up with a lot of conditional macros for OS and I/O related stuff such as...
0
by: David F. | last post by:
Getting this message so turned on /VERBOSE - part of the output is below (the only reference to searching of libc.lib). This is for a multi-threaded application and AFAIK all my libs are...
0
by: jason.pirok | last post by:
I've been reading other groups related to this error and I'm only getting more confused. I'm still quite new to MC++ and I could use a swift kick in the right direction. The application I'm...
4
by: saumya.agarwal | last post by:
Hi, I am executing a piece of code which continually tries to do the sprintf into the allocated buffer on a 64-bit RedHat linux machine. Here are the details of the system and the gcc version...
1
by: usa777 | last post by:
There are pthread_create symbols in libphread.so, libthread.so and libc.so. The following symbols displayed with the nm command: Value Size Type Bind Other Shndx Name ...
4
by: raashid bhatt | last post by:
how to print something with out calling libc functions like printf , puts etc.. This is the direct method how libc printf works on windows so why not use this one and get rid of MSVCRT.DLL...
12
by: Anna Smidt | last post by:
Hello again, I am trying to convert a VC6 project to VC9, and the linker tells me that it cannot open file 'LIBC.lib'. But I didn't find this lib referenced or added anywhere. I used the linker...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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

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.