diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2011-05-19 07:21:42 +0000 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2011-05-19 07:21:42 +0000 |
commit | 831826db9440c6d8f94cc57c85208d0c2674119e (patch) | |
tree | a65c0ef1a958d0b101fe6db796ab6838f40ddc65 /newlib/libc/stdio/fpurge.c | |
parent | 503ff5adc19e7d0eb5998dc3f6e4906e4aaebfa5 (diff) | |
download | cygnal-831826db9440c6d8f94cc57c85208d0c2674119e.tar.gz cygnal-831826db9440c6d8f94cc57c85208d0c2674119e.tar.bz2 cygnal-831826db9440c6d8f94cc57c85208d0c2674119e.zip |
* libc/include/stdio_ext.h: New header.
* libc/stdio/fpurge.c [!__rtems__] (__fpurge): New function.
Diffstat (limited to 'newlib/libc/stdio/fpurge.c')
-rw-r--r-- | newlib/libc/stdio/fpurge.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fpurge.c b/newlib/libc/stdio/fpurge.c index 41228efd7..7e23bb7fd 100644 --- a/newlib/libc/stdio/fpurge.c +++ b/newlib/libc/stdio/fpurge.c @@ -11,6 +11,8 @@ INDEX fpurge INDEX _fpurge_r +INDEX + __fpurge ANSI_SYNOPSIS #include <stdio.h> @@ -18,6 +20,11 @@ ANSI_SYNOPSIS int _fpurge_r(struct _reent *<[reent]>, FILE *<[fp]>); + #include <stdio.h> + #include <stdio_ext.h> + void __fpurge(FILE *<[fp]>); + + DESCRIPTION Use <<fpurge>> to clear all buffers of the given stream. For output streams, this discards data not yet written to disk. For input streams, @@ -26,6 +33,8 @@ but not yet read via <<getc>>. This is more severe than <<fflush>>, and generally is only needed when manually altering the underlying file descriptor of a stream. +<<__fpurge>> behaves exactly like <<fpurge>> but does not return a value. + The alternate function <<_fpurge_r>> is a reentrant version, where the extra argument <[reent]> is a pointer to a reentrancy structure, and <[fp]> must not be NULL. @@ -42,6 +51,9 @@ No supporting OS subroutines are required. #include <_ansi.h> #include <stdio.h> +#ifndef __rtems__ +#include <stdio_ext.h> +#endif #include <errno.h> #include "local.h" @@ -87,4 +99,15 @@ _DEFUN(fpurge, (fp), return _fpurge_r (_REENT, fp); } +#ifndef __rtems__ + +void +_DEFUN(__fpurge, (fp), + register FILE * fp) +{ + _fpurge_r (_REENT, fp); +} + +#endif + #endif /* _REENT_ONLY */ |