add fpurge

Eric Blake ebb9@byu.net
Sun Jun 28 11:51:00 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bash would like to use fpurge, as part of making file redirections to
builtin operators work correctly.  It is not (yet) standardized, but does
provide some useful semantics.  BSD has fpurge in <stdio.h>, Linux has
__fpurge (same behavior, but no return value) in <stdio_ext.h>.

OK to commit?  I wrote this implementation from scratch using fflush.c as
a reference, then tested it in cygwin, and verified that it passes the
gnulib unit test for fpurge (some BSD implementations fail the gnulib unit
test, because they leave read-write FILEs in an inconsistent state,
otherwise I might have just copied a BSD version).

I'm not sure why my rebuilt Makefile.in diff is larger than I expected; I
used autoconf 2.59 and automake 1.9.6 as directed in README.

2009-06-27  Eric Blake  <ebb9@byu.net>

	Add fpurge.
	* stdio/fpurge.c (fpurge, _fpurge_r): New file.
	* libc/stdio/Makefile.am (ELIX_4_SOURCES, CHEWOUT_FILES, fpurge):
	Build it.
	* libc/stdio/Makefile.in: Regenerated.
	* libc/include/stdio.h (fpurge, _fpurge_r): New declarations.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpGabYACgkQ84KuGfSFAYBQ9gCgvq3Vfbc+3FJA+vWqPWMq3KGh
CC0An0Kw+AJPPXYXloBaT6mf+l7mi3/4
=6wtg
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newlib.patch35
URL: <http://sourceware.org/pipermail/newlib/attachments/20090628/896f8eb9/attachment.ksh>


More information about the Newlib mailing list