On Mon, Oct 8, 2012 at 10:22 PM, naveen yadav <yad.naveen@xxxxxxxxx> wrote: > > I want to control the print message being sent to stdout and stderr > using printf(), vprintf() and fprintf() function call for better > performance. > > For this I have added following code in vfprintf() function > static int Verbose = 0; > if(stream == stdout || stream == stderr) > { > if (Verbose == 0) > Verbose = getenv ("PRINT") ? 1 : 2; > if (Verbose == 1) > return 0; > } That seems really unwise. Do this kind of thing in your application, not in your C library. If for some reason you truly must do it in your C library, do it at level of write, not at the level of printf. Ian