From 99d0e2341d3ff37b98eff9163b195b715ff8bddf Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 12 Mar 2016 23:37:01 +0100 Subject: Add __swhatbuf function from OpenBSD To fix a long-standing setvbuf bug, import __swhatbuf function from OpenBSD and only slightly rearrange for newlib. * libc/stdio/local.h (__swhatbuf_r): Declare. * libc/stdio/makebuf (__smakebuf_r): New function. (__smakebuf_r): Drop file handling code and call __smakebuf_r. Signed-off-by: Corinna Vinschen --- newlib/libc/stdio/local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'newlib/libc/stdio/local.h') diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index cf8e6a9..471442e 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -182,6 +182,7 @@ extern int _EXFUN(__stextmode,(int)); extern _VOID _EXFUN(__sinit,(struct _reent *)); extern _VOID _EXFUN(_cleanup_r,(struct _reent *)); extern _VOID _EXFUN(__smakebuf_r,(struct _reent *, FILE *)); +extern int _EXFUN(__swhatbuf_r,(struct _reent *, FILE *, size_t *, int *)); extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *))); extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(struct _reent *, FILE *))); struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); -- cgit v1.1