This is the definition of the write(2) system call.  You should also
check the implementation of printf(3) at the libc sources.  Look at
/usr/src/lib/libc/stdio/printf.c for more details about the way
printf() works in userlevel programs.

Right on. I think, however, that Auge is looking for a trace, not jsut the printf
source. More or less we bust out of printf() in libc to:
vfprintf /usr/src/lib/libc/stdio/vfprintf.c
__sprint /usr/src/lib/libc/stdio/vfprintf.c
__sfvwrite /usr/src/lib/libc/stdio/fvwrite.c
_swrite /usr/src/lib/libc/stdio/stdio.c
This is where you make a direct call to the file stream's write function. In printf's
case this is __swrite.
__swrite /usr/src/lib/libc/stdio/stdio.c
Simply, __swrite() calls _write (which equates to write()). Write is a simple syscall
trampoline that manifests int 0x80. This, of course, calls the kernel, which dumps
the thread into SYS_write. Skipping the interrupt code we can drop into SYS_write:
write /sys/kern/sys_generic.c
You should be able to trace the code from here.
Don

"nosotros tenemos mas influencia con sus hijos que tu tienes... pero los queremos.."



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to