[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seekable stdin test failure on OS X
From: |
Gary V. Vaughan |
Subject: |
Re: seekable stdin test failure on OS X |
Date: |
Mon, 2 Apr 2007 18:08:39 +0100 |
On 2 Apr 2007, at 17:24, Paul Eggert wrote:
"Gary V. Vaughan" <address@hidden> writes:
At worst we need an autoconf test to see whether fflush works on
stdin,
but maybe all that is needed is to call fpurge when present, and
fallback to fflush otherwise?
For what it's worth, on Solaris it's called __fpurge and is declared
in <stdio_ext.h> (along with __fpending and friends). The
documentation says it "discards any pending buffered I/O on the
stream." It returns void.
__fpurge appears to be supported on Linux too:
http://www.die.net/doc/linux/man/man3/fpurge.3.html
On Mac OS there doesn't seem to be any evidence of an __fpurge function:
] man __fpurge
No manual entry for __fpurge
] find /usr/include -name '*.h' -exec fgrep -l __fpurge {} \;
] uname -a
Darwin Garys-MacBook.local 8.9.1 Darwin Kernel Version 8.9.1: Thu
Feb 22 20:55:00 PST 2007; root:xnu-792.18.15~1/RELEASE_I386 i386 i386
Even on Linux, the fflush man page doesn't mention input streams:
http://www.die.net/doc/linux/man/man3/fflush.3.html
So it seems that using fflush(stdin) is probably the wrong thing
to do altogether for a portable application.
Cheers,
Gary
--
())_. Email me: address@hidden
( '/ Read my blog: http://blog.azazil.net
/ )= ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912
PGP.sig
Description: This is a digitally signed message part
- Re: seekable stdin test failure on OS X, Eric Blake, 2007/04/02
- Re: seekable stdin test failure on OS X, Gary V. Vaughan, 2007/04/02
- Re: seekable stdin test failure on OS X, Paul Eggert, 2007/04/02
- Re: seekable stdin test failure on OS X, Ben Pfaff, 2007/04/02
- Re: seekable stdin test failure on OS X, Paul Eggert, 2007/04/02
- Re: seekable stdin test failure on OS X, Ben Pfaff, 2007/04/02
- Re: seekable stdin test failure on OS X, Eric Blake, 2007/04/02
- Re: seekable stdin test failure on OS X, Eric Blake, 2007/04/02
- Re: seekable stdin test failure on OS X, Eric Blake, 2007/04/07
- Re: seekable stdin test failure on OS X, Paul Eggert, 2007/04/09
- Re: seekable stdin test failure on OS X, Eric Blake, 2007/04/09