summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-05 12:25:31 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-05 12:25:31 -0400
commite72180083e4b0203d1883b6054198decdb60071c (patch)
tree3032022750932b31296345883363c96e532fb956 /src
parent8b61c816933abe9ac152a05ccf8bd801f7bc13bf (diff)
downloadmusl-e72180083e4b0203d1883b6054198decdb60071c.tar.gz
musl-e72180083e4b0203d1883b6054198decdb60071c.tar.bz2
musl-e72180083e4b0203d1883b6054198decdb60071c.tar.xz
musl-e72180083e4b0203d1883b6054198decdb60071c.zip
add more legacy functions: setlinebuf and setbuffer
Diffstat (limited to 'src')
-rw-r--r--src/stdio/setbuf.c2
-rw-r--r--src/stdio/setbuffer.c7
-rw-r--r--src/stdio/setlinebuf.c7
3 files changed, 15 insertions, 1 deletions
diff --git a/src/stdio/setbuf.c b/src/stdio/setbuf.c
index 205afcfe..1b98d503 100644
--- a/src/stdio/setbuf.c
+++ b/src/stdio/setbuf.c
@@ -1,4 +1,4 @@
-#include "stdio_impl.h"
+#include <stdio.h>
void setbuf(FILE *f, char *buf)
{
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);
+}
diff --git a/src/stdio/setlinebuf.c b/src/stdio/setlinebuf.c
new file mode 100644
index 00000000..b93c4d6a
--- /dev/null
+++ b/src/stdio/setlinebuf.c
@@ -0,0 +1,7 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+
+void setlinebuf(FILE *f)
+{
+ setvbuf(f, 0, _IOLBF, 0);
+}