Results 1 to 3 of 3
Allow me to put on the "noob hat" for a minute while I ask this question:
Where are the definitions for C library functions located? It was just recently that ...
- 04-24-2010 #1
Definitions for C Library Functions
Allow me to put on the "noob hat" for a minute while I ask this question:
Where are the definitions for C library functions located? It was just recently that I realized that header files don't actually define any functions, they merely include their prototypes. For instance, stdio.h includes the following line:
This just means that the definition of printf() is located in another file. What file? Is there some kind of default shared object file that is automatically included during compilation?Code:extern int printf (__const char *__restrict __format, ...);
- 04-24-2010 #2
The code for these standard functions is in the GNU C runtime library. (glibc)
Usually an application employs the functions from the shared libraries. (/lib/libc.so etc.)
See GNU C Library - GNU Project - Free Software Foundation (FSF)
for the source code.Debian GNU/Linux -- You know you want it.
- 04-27-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Check the man pages for detailed information about the purpose and use of any standard library function. IE, man 3 printf will give you the man page for the printf() and related library functions. The reason for the '3' argument is that man printf will only give you the man page for the system printf command (/usr/bin/printf).
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote