summaryrefslogtreecommitdiff
path: root/src/stdio/setbuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/setbuffer.c')
-rw-r--r--src/stdio/setbuffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stdio/setbuffer.c b/src/stdio/setbuffer.c
new file mode 100644
index 00000000..71233d2e
--- /dev/null
+++ b/src/stdio/setbuffer.c
@@ -0,0 +1,7 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+
+void setbuffer(FILE *f, char *buf, size_t size)
+{
+ setvbuf(f, buf, buf ? _IOFBF : _IONBF, size);
+}