Richard M. Stallman wrote: > Why not have glibc incorporate the moral equivalent of the "unlocked" > stdio routines (fwrite_unlocked, printf_unlocked, etc.), like > fwrite_block? > >I am not sure what "unlocked" means, >
I'm referring to the non-thread-safe stdio variants exported by glibc and supported as a GNULIB module. >but any solution like this would >only work on GNU. It would be better to use an equally simple >approach that will work on other systems also: to define simple >functions inside CVS to replace fwrite, fprintf, etc. > > Not exactly. If a solution like this were to go into GLIBC, then it becomes much more likely that it can be shared with GNULIB, which means that the infrastructure for it is already in CVS and that supporting it won't rely exclusively on the extremely small and overworked CVS team. Even if it isn't shared with GNULIB, we can probably rely on the GLIBC folks to handle portability issues and import a file or two from GLIBC directly into the CVS tree. >My suggestion is to write a function cvs_fprintf that uses vsnprintf >and alloca so as to generate the entire message, and then calls fwrite >in a suitable loop with select to output the message. That should be >simple enough. How about it? > >I will write the function for you if you don't want to write it. >It would give me an opportunity to restudy how varargs works. > > Again, I am less afraid of writing this than maintaining it, though I feel I have the time to do neither just now. The whole of stdio would need replacement functions in CVS for this to work consistently: fwrite, fflush, fprintf, printf, etc. - not just fwrite and not just fprintf. If anyone were to contribute such a complete patch, I would consider it more seriously, still subject, of course, to further comment from the other CVS developers. To summarize, if such a patch were accepted into GNULIB, I would have no problem importing the module into CVS. Only accepted into GLIBC, I would have to think about it some more and examine how easy it would be to make the wrappers stand-alone. Applied only to CVS, I remain reluctant to accept the probable maintenance cost but may consider a complete patch, pending further comment from the other CVS developers and the results of tests on diverse platforms. Regards, Derek _______________________________________________ Bug-cvs mailing list Bug-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-cvs