setvbuf functionality to pug.c