Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined! KPolulak's Avatar
    Join Date
    Feb 2009
    Location
    New Jersey, USA
    Posts
    42

    Question 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:

    Code:
    extern int printf (__const char *__restrict __format, ...);
    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?

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    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.

  3. #3
    Linux Guru Rubberman's Avatar
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...