How can I found the implemention of the "printf" in glibc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mars

    How can I found the implemention of the "printf" in glibc

    Which file is the "printf" implemention in glibc?
    The stdio.c is very small.
    It seems using __printf_chk (__USE_FORTIFY_ LEVEL - 1, __VA_ARGS__)
    And __printf_chk using __nldbl___vfpri ntf_chk, but
    __nldbl___vfpri ntf_chk using __printf_chk.
    I found the implement as following, I can not understand how it works.
    int attribute_hidde n __printf_chk (int flag, const char *fmt, ...)
    {
    va_list arg;
    int done;

    va_start (arg, fmt);
    done = __nldbl___vfpri ntf_chk (stdout, flag, fmt, arg);
    va_end (arg);

    return done;
    }

    int attribute_compa t_text_section __nldbl___vfpri ntf_chk (FILE *s, int
    flag, const char *fmt, va_list ap)
    {
    int res;
    set_no_long_dou ble ();
    res = __vfprintf_chk (s, flag, fmt, ap);
    clear_no_long_d ouble ();
    return res;
    }
  • Boon

    #2
    Re: How can I found the implemention of the "printf&qu ot; in glibc

    mars wrote:
    Which file is the "printf" implementation in glibc?


    Mailing lists

    libc-help: The libc-help list is intended for all glibc questions
    including build problems, C library usage, and more. No question about
    glibc is ever wrong on this list.



    Regards.

    Comment

    Working...