I am using Linux (ubuntu).
I want to read the function definitions of some functions which are declared in header files like stdlib.h
I tried looking for stdlib.c
but could not find one.
Can anyone please let me know where can i find the corresponding code file on my system.
Forgive me if i am being too naive. Thanks
You need to download the source code for glibc. Your distribution will typically only ship with a compiled version of the C library. See also the Wikipedia article.
(E.g. on Debian-like systems try apt-get source libc6
.)
glibc isn't the only C library for Linux-like systems, there exist a couple of "competitors". For example, uClib is a very small alternative intended for embedded applications.
For most Linux-based systems, the standard library is provided by glibc. You can browse the git repository here:
http://sourceware.org/git/?p=glibc.git;a=tree
Note that much of the interesting source is tucked away under the sysdeps
tree, particularly sysdeps/unix/sysv/linux
and similar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With