where is the printf source for busybox?
Kim Chan
ckim at etri.re.kr
Tue Mar 11 21:44:20 EDT 2014
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140312/b750886e/attachment.html
More information about the Kernelnewbies
mailing list