where is the printf source for busybox?

Kim Chan ckim at etri.re.kr
Wed Mar 12 02:55:10 EDT 2014


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?
Thanks in adv.
Chan
________________________________
From : "Mohan L" <l.mohanphy at gmail.com>
Sent : 2014-03-12 15:31:24 ( +09:00 )
To : Kim Chan <ckim at etri.re.kr>
Cc : Dave Hylands <dhylands at gmail.com>, kernelnewbies at kernelnewbies.org <kernelnewbies at kernelnewbies.org>
Subject : Re: where is the printf source for busybox?






ssize_t attribute_hidden _cs_write(void *cookie, const char *buf, size_t bufsize)
{
        return write(*((int *) cookie), (char *) buf, bufsize);
}
what does cs stand for here? (Hm.. seems like custom streams..in the code) and I couldn't follow past write above. Where is the function write defined?


Hi Chan,

write is a system call.

$ man 2 write

syscall table for x86 architecture can be found in :  <path>/arch/x86/syscalls/syscall_32.tbl

# cat <path>/arch/x86/syscalls/syscall_32.tbl | grep 'write'

4       i386    write                   sys_write

The format is:
<number> <abi> <name> <entry point> <compat entry point>

search sys_write definition in kernel source.

Thanks
Mohan L

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140312/906e3336/attachment.html 


More information about the Kernelnewbies mailing list