sprintf question

Robin Getz rgetz@blackfin.uclinux.org
Wed Feb 28 16:11:00 GMT 2007


I was trying to use something like:

int i=0;
char buff[100];

sprintf(buff,"%i\n", i);

It seems that sprintf, in libc/stdio/sprintf.c calls _vfprintf_r, which needs 
<<close>>, <<fstat>>, <<isatty>>, <<lseek>>, <<read>>, <<sbrk>>, <<write>>.

I thought it strange, that operations purely on a buffer, would require 
supporting OS file subroutines. I can understand why these are necessary for 
printf, fprintf, but why sprintf?

Can someone explain?


More information about the Newlib mailing list