mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 04:31:56 +00:00
add more legacy functions: setlinebuf and setbuffer
This commit is contained in:
@ -156,6 +156,8 @@ char *cuserid(char *);
|
|||||||
#define off64_t off_t
|
#define off64_t off_t
|
||||||
int asprintf(char **, const char *, ...);
|
int asprintf(char **, const char *, ...);
|
||||||
int vasprintf(char **, const char *, va_list);
|
int vasprintf(char **, const char *, va_list);
|
||||||
|
void setlinebuf(FILE *);
|
||||||
|
void setbuffer(FILE *, char *, size_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "stdio_impl.h"
|
#include <stdio.h>
|
||||||
|
|
||||||
void setbuf(FILE *f, char *buf)
|
void setbuf(FILE *f, char *buf)
|
||||||
{
|
{
|
||||||
|
7
src/stdio/setbuffer.c
Normal file
7
src/stdio/setbuffer.c
Normal file
@ -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);
|
||||||
|
}
|
7
src/stdio/setlinebuf.c
Normal file
7
src/stdio/setlinebuf.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void setlinebuf(FILE *f)
|
||||||
|
{
|
||||||
|
setvbuf(f, 0, _IOLBF, 0);
|
||||||
|
}
|
Reference in New Issue
Block a user