Hi,
I've had this question for some time past and I would like to know the answer 
now..
I wanted to follow a printf in busybox but couldn't find the source of the 
printf function.
Then I throught probably the printf is provided by the system library where 
printf is connected to proper linux system call. (Is it printk?)
So I checkd LD_LIBRARY_PATH of my shell and found libc.so under /lib. I could 
see by 'nm libc.so' that printf is in the library.
But where can I see the printf source? Is it under gcc source? in GNU sdk, 
under glibc-2.16.0, I tried
# grep 'int printf(' * -r
but nothing comes up.
In linux kernel source doing the same gaves me
        arch/x86/boot/boot.h:int printf(const char *fmt, ...);
        arch/x86/boot/printf.c:int printf(const char *fmt, ...)
        arch/um/include/shared/kern.h:extern int printf(const char *fmt, ...);
        arch/um/os-Linux/user_syms.c:extern int printf(const char *, ...);
        arch/powerpc/boot/stdio.h:extern int printf(const char *fmt, ...) 
__attribute__((format(printf, 1, 2)));
so printf is defined only for x86 architecture?
I understand printf is for user program not kernel, so I want to see how the 
printf is connected to kernel print function. (the system call, I know in 
sparc, linux system call is trap 0x90, function 59 when using assembly)
Where can I find the printf (user program) source?
Thanks in advance.
Chan





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to