how setbuf is working in c program