Changes the the buffering mode of the given file stream stream as indicated by the argument mode. In addition,

If if buffer is a null pointer, resizes of the internal buffer to size.

If buffer is not a null pointer, instructs the stream to use the user-provided buffer of size size beginning at buffer. The stream must be closed (with fclose) before the lifetime of the array pointed to by buffer ends. The contents of the array after a successful call to setvbuf are indeterminate and any attempt to use it is undefined behavior.