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

M

mars

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___vfprintf_chk, but
__nldbl___vfprintf_chk using __printf_chk.
I found the implement as following, I can not understand how it works.
int attribute_hidden __printf_chk (int flag, const char *fmt, ...)
{
va_list arg;
int done;

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

return done;
}

int attribute_compat_text_section __nldbl___vfprintf_chk (FILE *s, int
flag, const char *fmt, va_list ap)
{
int res;
set_no_long_double ();
res = __vfprintf_chk (s, flag, fmt, ap);
clear_no_long_double ();
return res;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top