From: Jarkko Hietaniemi Date: Wed, 12 May 1999 09:33:08 +0000 (+0000) Subject: Detect whether fflush(NULL) works as per change #3352. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66fe083fc7dcf6d1e6ac684950a8d123a6bddde0;p=p5sagit%2Fp5-mst-13.2.git Detect whether fflush(NULL) works as per change #3352. p4raw-link: @3352 on //depot/perl: 45bc920620377d5a7720d3d562c48df1eb0c2e68 p4raw-id: //depot/cfgperl@3398 --- diff --git a/Configure b/Configure index d359877..ec15a53 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed May 12 01:15:37 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Wed May 12 12:24:25 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <try.c < +int main() { + FILE* p = fopen("try.out", "w"); + fputc('x', p); + fflush(NULL); + _exit(0); +} +EOCP + set try + $rm -f try.out + if eval $compile_ok; then + case "`$cat try.out`" in + x) cat >&4 <&4 <&4 <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- */ #$usedl USE_DYNAMIC_LOADING /**/ +/* FFLUSH_NULL: + * This symbol, if defined, tells that fflush(NULL) does flush + * all pending stdio output. + */ +#$fflushNULL FFLUSH_NULL /**/ + /* DB_Prefix_t: * This symbol contains the type of the prefix structure element * in the header file. In older versions of DB, it was diff --git a/perl.h b/perl.h index 5cbecd2..4d8b45c 100644 --- a/perl.h +++ b/perl.h @@ -1455,7 +1455,9 @@ typedef pthread_key_t perl_key; * XXX the default needs a Configure test, as it may not work everywhere. */ #ifndef PERL_FLUSHALL_FOR_CHILD -#define PERL_FLUSHALL_FOR_CHILD PerlIO_flush((PerlIO*)NULL) +# if (defined(USE_STDIO) && defined(FFLUSH_NULL)) || defined(USE_SFIO) +# define PERL_FLUSHALL_FOR_CHILD PerlIO_flush((PerlIO*)NULL) +# endif #endif /* Some unistd.h's give a prototype for pause() even though