mirror of
https://github.com/fluencelabs/musl
synced 2025-04-27 08:02:16 +00:00
23 lines
693 B
C
23 lines
693 B
C
|
#include "stdio_impl.h"
|
||
|
|
||
|
/* This function makes no attempt to protect the user from his/her own
|
||
|
* stupidity. If called any time but when then ISO C standard specifically
|
||
|
* allows it, all hell can and will break loose, especially with threads!
|
||
|
*
|
||
|
* This implementation ignores all arguments except the buffering type,
|
||
|
* and uses the existing buffer allocated alongside the FILE object.
|
||
|
* In the case of stderr where the preexisting buffer is length 1, it
|
||
|
* is not possible to set line buffering or full buffering. */
|
||
|
|
||
|
int setvbuf(FILE *f, char *buf, int type, size_t size)
|
||
|
{
|
||
|
f->lbf = EOF;
|
||
|
|
||
|
if (type == _IONBF)
|
||
|
f->buf_size = 1;
|
||
|
else if (type == _IOLBF)
|
||
|
f->lbf = '\n';
|
||
|
|
||
|
return 0;
|
||
|
}
|