This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sprintf question


All:

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?

Thanks
-Robin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]