where is the printf source for busybox?

Dave Hylands dhylands at gmail.com
Wed Mar 12 13:54:36 EDT 2014


Hi,


On Tue, Mar 11, 2014 at 11:55 PM, Kim Chan <ckim at etri.re.kr> wrote:

>
> Wow, that was it. I'm happy to hear that because I thought it should end
> up with a system call anyway.
> Then isn't there some codes making the system call? Or is it that the
> compiler understands that 'write' is a system call and inserts the assembly
> code for calling it by itself?
>

In uclibc, the write source code is found here:
http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/common/write.c

How the syscall is actually implemented is architecture specific, and will
be in one of the directories here:
http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux

For example, for ARM, with EABI, then I believe that it winds up here:
http://git.uclibc.org/uClibc/tree/libc/sysdeps/linux/arm/syscall-eabi.S

The SWI instruction transfers control to the kernel.

On the kernel side, how the syscalls get handled is also architecture
specific, but it will generally wind up at a function called sys_FUNCTION,
however the generation of the function name is usually hidden behind a
macro.

So sys_write in the kernel winds up being declared here:
http://lxr.linux.no/#linux+v3.13.5/fs/read_write.c#L514

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140312/e4cc45e2/attachment.html 


More information about the Kernelnewbies mailing list