summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure233
-rw-r--r--INSTALL7
-rw-r--r--config_h.SH55
-rw-r--r--configure.com35
-rw-r--r--embed.h2
-rw-r--r--ext/Devel/Peek/Peek.xs3
-rw-r--r--ext/Socket/Socket.xs45
-rw-r--r--global.sym1
-rw-r--r--hints/dec_osf.sh15
-rw-r--r--objXSUB.h2
-rw-r--r--perl.h14
-rw-r--r--pod/perldiag.pod5
-rw-r--r--proto.h1
-rw-r--r--util.c34
14 files changed, 406 insertions, 46 deletions
diff --git a/Configure b/Configure
index e326c3e303..4a78ff73f7 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 Mon Apr 19 22:21:08 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Fri May 14 10:24:50 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -404,6 +404,7 @@ d_madvise=''
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
+d_memchr=''
d_memcmp=''
d_memcpy=''
d_memmove=''
@@ -572,6 +573,8 @@ lddlflags=''
usedl=''
doublesize=''
ebcdic=''
+fflushNULL=''
+fflushall=''
fpostype=''
gidtype=''
groupstype=''
@@ -605,6 +608,7 @@ i_mntent=''
i_ndbm=''
i_netdb=''
i_neterrno=''
+i_netinettcp=''
i_niin=''
i_sysin=''
i_poll=''
@@ -795,6 +799,8 @@ d_fsetpos64=''
d_ftell64=''
d_ftello64=''
d_tmpfile64=''
+d_stdio_stream_array=''
+stdio_stream_array=''
sysman=''
trnl=''
uidtype=''
@@ -4342,6 +4348,7 @@ echo "Your cpp writes the filename in the $pos field of the line."
$cat >findhdr <<EOF
$startsh
wanted=\$1
+name=''
for usrincdir in $usrinc
do
if test -f \$usrincdir/\$wanted; then
@@ -4357,6 +4364,7 @@ while read cline; do
name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
case "\$name" in
*[/\\\\]\$wanted) echo "\$name"; exit 0;;
+ *[\\\\/]\$wanted) echo "\$name"; exit 0;;
*) name='';;
esac;
done;
@@ -8008,6 +8016,7 @@ else
eval $setvar
done
fi
+
: see if flock exists
set flock d_flock
eval $inlibc
@@ -8674,6 +8683,10 @@ eval $inlibc
set mbtowc d_mbtowc
eval $inlibc
+: see if memchr exists
+set memchr d_memchr
+eval $inlibc
+
: see if memcmp exists
set memcmp d_memcmp
eval $inlibc
@@ -9948,6 +9961,41 @@ esac
set d_stdiobase
eval $setvar
+$cat >&4 <<EOM
+Checking how to access stdio streams by file descriptor number...
+EOM
+case "$stdio_stream_array" in
+'') $cat >try.c <<EOCP
+#include <stdio.h>
+int main() {
+ if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
+ printf("yes\n");
+}
+EOCP
+ for s in _iob __iob __sF
+ do
+ set try -DSTDIO_STREAM_ARRAY=$s
+ if eval $compile; then
+ case "`./try$exe_ext`" in
+ yes) stdio_stream_array=$s; break ;;
+ esac
+ fi
+ done
+ $rm -f try.* try$exe_ext
+esac
+case "$stdio_stream_array" in
+'') $cat >&4 <<EOM
+I can't figure out how to access stdio streams by file descriptor number.
+EOM
+ d_stdio_stream_array="$undef"
+ ;;
+*) $cat >&4 <<EOM
+You can access stdio streams by file descriptor number by the $stdio_stream_array array.
+EOM
+ d_stdio_stream_array="$define"
+ ;;
+esac
+
: see if strcoll exists
set strcoll d_strcoll
eval $inlibc
@@ -10914,6 +10962,179 @@ $rm -f tebcdic.c tebcdic
set ebcdic
eval $setvar
+# SunOS has a <unistd.h> which we generally avoid, but need for this test.
+# For everyone else, we'll trust i_unistd.
+t_unistd=$i_unistd
+case "$osname" in
+sunos) $test -f /usr/include/unistd.h && t_unistd=$define ;;
+esac
+$cat >&4 <<EOM
+Checking how to flush all pending stdio output...
+EOM
+$cat >try.c <<EOCP
+#include <stdio.h>
+#$t_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#$d_sysconf HAS_SYSCONF
+#$stdio_stream_array
+int main() {
+ FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
+ fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+ fprintf(p, "x");
+# endif
+#endif
+#ifdef TRY_FFLUSH_NULL
+ fflush(NULL);
+#endif
+#ifdef TRY_FFLUSH_ALL
+ {
+ long open_max = -1;
+# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+ open_max = sysconf(_SC_OPEN_MAX);
+# else
+# ifdef FOPEN_MAX
+# open_max = FOPEN_MAX;
+# else
+# ifdef OPEN_MAX
+# open_max = OPEN_MAX;
+# else
+# ifdef _NFILE
+# open_max = _NFILE;
+# endif
+# endif
+# endif
+# endif
+# ifdef HAS_STDIO_STREAM_ARRAY
+ if (open_max > 0) {
+ long i;
+ for (i = 0; i < open_max; i++)
+ fflush(&$stdio_stream_array[i]);
+ }
+ }
+# endif
+#endif
+ _exit(42);
+}
+EOCP
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+ output=''
+ set try -DTRY_FPUTC
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPUTC
+ fi
+ fi
+ case "$output" in
+ '')
+ set try -DTRY_FPRINTF
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPRINTF
+ fi
+ fi
+ ;;
+ esac
+fi
+: check for fflush NULL behaviour
+case "$fflushNULL" in
+'') set try -DTRY_FFLUSH_NULL $output
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushNULL="`$cat try.out`"
+ fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushNULL" in
+ x) $cat >&4 <<EOM
+Your fflush(NULL) works okay.
+EOM
+ fflushNULL="$define"
+ ;;
+ '') $cat >&4 <<EOM
+Your fflush(NULL) isn't working (contrary to ANSI C).
+EOM
+ fflushNULL="$undef"
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether your fflush(NULL) works or not.
+I'm assuming it doesn't (contrary to ANSI C).
+EOM
+ fflushNULL="$undef"
+ ;;
+ esac
+ ;;
+$define|true|[yY]*)
+ fflushNULL="$define"
+ ;;
+*)
+ fflushNULL="$undef"
+ ;;
+esac
+: check for fflush all behaviour
+case "$fflushall" in
+'') set try -DTRY_FFLUSH_ALL $output
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushall="`$cat try.out`"
+ fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushall" in
+ x) $cat >&4 <<EOM
+Flushing explicitly all the stdio streams works.
+EOM
+ fflushall="$define"
+ ;;
+ '') $cat >&4 <<EOM
+Flushing explicitly all the stdio streams doesn't work.
+EOM
+ fflushall="$undef"
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
+I'm assuming it doesn't.
+EOM
+ fflushall="$undef"
+ ;;
+ esac
+ case "$fflushall$fflushNULL" in
+ undefdefine)
+ $cat >&4 <<EOM
+(That's ok. I'll use fflush(NULL) instead.)
+EOM
+ ;;
+ esac
+ ;;
+$define|true|[yY]*)
+ fflushall="$define"
+ ;;
+*)
+ fflushall="$undef"
+ ;;
+esac
+case "$fflushNULL$fflushall" in
+undefundef)
+ $cat <<EOM
+I cannot figure out how to flush pending stdio output.
+EOM
+ ;;
+esac
+$rm -f try.* try$exe_ext
+
: see what type file positions are declared as in the library
rp="What is the type for file position used by fsetpos()?"
set fpos_t fpostype long stdio.h sys/types.h
@@ -11957,6 +12178,10 @@ esac
set i_neterrno
eval $setvar
+: see if netinet/tcp.h is available
+set netinet/tcp.h i_netinettcp
+eval $inhdr
+
: see if this is a poll.h system
set poll.h i_poll
eval $inhdr
@@ -12821,6 +13046,7 @@ d_madvise='$d_madvise'
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
+d_memchr='$d_memchr'
d_memcmp='$d_memcmp'
d_memcpy='$d_memcpy'
d_memmove='$d_memmove'
@@ -12933,6 +13159,7 @@ d_statfsflags='$d_statfsflags'
d_statvfs='$d_statvfs'
d_stdio_cnt_lval='$d_stdio_cnt_lval'
d_stdio_ptr_lval='$d_stdio_ptr_lval'
+d_stdio_stream_array='$d_stdio_stream_array'
d_stdiobase='$d_stdiobase'
d_stdstdio='$d_stdstdio'
d_store64='$d_store64'
@@ -12997,6 +13224,8 @@ eunicefix='$eunicefix'
exe_ext='$exe_ext'
expr='$expr'
extensions='$extensions'
+fflushNULL='$fflushNULL'
+fflushall='$fflushall'
find='$find'
firstmakefile='$firstmakefile'
flex='$flex'
@@ -13039,6 +13268,7 @@ i_mntent='$i_mntent'
i_ndbm='$i_ndbm'
i_netdb='$i_netdb'
i_neterrno='$i_neterrno'
+i_netinettcp='$i_netinettcp'
i_niin='$i_niin'
i_poll='$i_poll'
i_pthread='$i_pthread'
@@ -13242,6 +13472,7 @@ stdio_bufsiz='$stdio_bufsiz'
stdio_cnt='$stdio_cnt'
stdio_filbuf='$stdio_filbuf'
stdio_ptr='$stdio_ptr'
+stdio_stream_array='$stdio_stream_array'
strings='$strings'
submit='$submit'
subversion='$subversion'
diff --git a/INSTALL b/INSTALL
index fade1f9e5c..c5120d62e7 100644
--- a/INSTALL
+++ b/INSTALL
@@ -876,13 +876,6 @@ If none of them help, then see L<"Reporting Problems"> below.
=over 4
-=item Environment variable clashes
-
-Configure uses a CONFIG variable that is reported to cause trouble on
-ReliantUnix 5.44. If your system sets this variable, you can try
-unsetting it before you run Configure. Configure should eventually
-be fixed to avoid polluting the namespace of the environment.
-
=item Running Configure Interactively
If Configure runs into trouble, remember that you can always run
diff --git a/config_h.SH b/config_h.SH
index 00388e0fa6..5bc9274e2f 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -1449,17 +1449,17 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
* This macro surrounds its token with double quotes.
*/
#if $cpp_stuff == 1
-# define CAT2(a,b)a/**/b
-# define STRINGIFY(a)"a"
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
/* If you can get stringification with catify, tell me how! */
-#else
-# if $cpp_stuff == 42
-# define CAT2(a,b)a ## b
-# define StGiFy(a)# a
-# define STRINGIFY(a)StGiFy(a)
-# else
-# include "Bletch: How does this C preprocessor catenate tokens?"
-# endif
+#endif
+#if $cpp_stuff == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if $cpp_stuff != 1 && $cpp_stuff != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
#endif
/* CPPSTDIN:
@@ -1700,6 +1700,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define LONGLONGSIZE $longlongsize /**/
#endif
+/* HAS_MEMCHR:
+ * This symbol, if defined, indicates that the memchr routine is available
+ * to locate characters within a C string.
+ */
+#$d_memchr HAS_MEMCHR /**/
+
/* HAS_MMAP:
* This symbol, if defined, indicates that the mmap system call is
* available to map a file into memory.
@@ -2213,6 +2219,18 @@ sed <<!GROK!THIS! >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.
+ */
+/* FFLUSH_ALL:
+ * This symbol, if defined, tells that to flush
+ * all pending stdio output one must loop through all
+ * the stdio file handles and fflush them.
+ */
+#$fflushNULL FFLUSH_NULL /**/
+#$fflushall FFLUSH_ALL /**/
+
/* DB_Prefix_t:
* This symbol contains the type of the prefix structure element
* in the <db.h> header file. In older versions of DB, it was
@@ -2244,6 +2262,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$i_mntent I_MNTENT /**/
+/* I_NETINET_TCP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <netinet/tcp.h>.
+ */
+#$i_netinettcp I_NETINET_TCP /**/
+
/* I_POLL:
* This symbol, if defined, indicates that <poll.h> exists and
* should be included.
@@ -2445,6 +2469,17 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_ftello64 HAS_FTELLO64 /**/
#$d_tmpfile64 HAS_TMPFILE64 /**/
+/* HAS_STDIO_STREAM_ARRAY:
+ * This symbol, if defined, tells that there is an array
+ * holding the stdio streams.
+ */
+/* STDIO_STREAM_ARRAY:
+ * This symbol tells the name of the array holding the stdio streams.
+ * Usual values include _iob, __iob, and __sF.
+ */
+#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY /**/
+#define STDIO_STREAM_ARRAY $stdio_stream_array
+
/* USE_64_BITS:
* This symbol, if defined, indicates that 64-bit interfaces should
* be used when available. If not defined, the native default interfaces
diff --git a/configure.com b/configure.com
index 388ba6b929..6a1c37ae82 100644
--- a/configure.com
+++ b/configure.com
@@ -1992,6 +1992,32 @@ $ SET DEFAULT [-.vms]
$ @subconfigure
$ SET DEFAULT 'dflt
$!
+$! Warn of dangerous logical names
+$!
+$Bad_logical: SUBROUTINE
+$ IF f$trnlnm(p1) .nes. ""
+$ THEN
+$ IF f$search("config.msg") .nes. ""
+$ THEN
+$ OPEN/APPEND CONFIG config.msg
+$ ELSE
+$ OPEN/WRITE CONFIG config.msg
+$ ENDIF
+$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
+$ WRITE CONFIG " deassign before building ''package'"
+$ CLOSE CONFIG
+$ ENDIF
+$ EXIT
+$ ENDSUBROUTINE ! Bad_logical
+$ echo ""
+$ echo4 "%Config-I-VMS, Checking for dangerous pre extant logical names."
+$ CALL Bad_logical "TMP"
+$ CALL Bad_logical "LIB"
+$ CALL Bad_logical "T"
+$ CALL Bad_logical "FOO"
+$ CALL Bad_logical "EXT"
+$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
+$!
$! %Config-I-VMS, write perl_setup.com here
$!
$ echo ""
@@ -2078,6 +2104,15 @@ $ ENDIF
$ echo4 " ''make'''makefile'", macros
$ echo4 ""
$!
+$ IF ( F$SEARCH("config.msg").NES."" )
+$ THEN
+$ echo "Hmm. I also noted the following information while running:"
+$ echo ""
+$ type config.msg
+$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
+$ DELETE/NOLOG/NOCONFIRM config.msg;
+$ ENDIF
+$!
$Clean_up:
$ IF (silent)
$ THEN
diff --git a/embed.h b/embed.h
index aba2f59129..8c2474ad2d 100644
--- a/embed.h
+++ b/embed.h
@@ -320,6 +320,7 @@
#define my_chsize Perl_my_chsize
#define my_exit Perl_my_exit
#define my_failure_exit Perl_my_failure_exit
+#define my_fflush_all Perl_my_fflush_all
#define my_htonl Perl_my_htonl
#define my_lstat Perl_my_lstat
#define my_memcmp Perl_my_memcmp
@@ -1378,6 +1379,7 @@
#define my_exit CPerlObj::Perl_my_exit
#define my_exit_jump CPerlObj::Perl_my_exit_jump
#define my_failure_exit CPerlObj::Perl_my_failure_exit
+#define my_fflush_all CPerlObj::Perl_my_fflush_all
#define my_htonl CPerlObj::Perl_my_htonl
#define my_lstat CPerlObj::Perl_my_lstat
#define my_memcmp CPerlObj::Perl_my_memcmp
diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs
index d193e312dd..d5066c1d5e 100644
--- a/ext/Devel/Peek/Peek.xs
+++ b/ext/Devel/Peek/Peek.xs
@@ -116,7 +116,8 @@ DeadCode()
}
#endif /* !PURIFY */
-#if defined(PERL_DEBUGGING_MSTATS)
+#if defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS) \
+ || (defined(MYMALLOC) && !defined(PLAIN_MALLOC))
# define mstat(str) dump_mstats(str)
#else
# define mstat(str) \
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index b8e34083ee..b2b145577f 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -6,28 +6,27 @@
# ifdef I_SYS_TYPES
# include <sys/types.h>
# endif
-#include <sys/socket.h>
-#ifdef MPE
-# define PF_INET AF_INET
-# define PF_UNIX AF_UNIX
-# define SOCK_RAW 3
-#endif
-#ifdef I_SYS_UN
-#include <sys/un.h>
-#endif
+# include <sys/socket.h>
+# ifdef MPE
+# define PF_INET AF_INET
+# define PF_UNIX AF_UNIX
+# define SOCK_RAW 3
+# endif
+# ifdef I_SYS_UN
+# include <sys/un.h>
+# endif
# ifdef I_NETINET_IN
# include <netinet/in.h>
# endif
-#include <netdb.h>
-#ifdef I_ARPA_INET
-# include <arpa/inet.h>
-#endif
+# include <netdb.h>
+# ifdef I_ARPA_INET
+# include <arpa/inet.h>
+# endif
+# ifdef I_NETINET_TCP
+# include <netinet/tcp.h>
+# endif
#else
-#include "sockadapt.h"
-#endif
-
-#ifndef WIN32 /* I_NETINET_TCP */
-#include <netinet/tcp.h>
+# include "sockadapt.h"
#endif
#ifdef I_SYSUIO
@@ -35,21 +34,21 @@
#endif
#ifndef AF_NBS
-#undef PF_NBS
+# undef PF_NBS
#endif
#ifndef AF_X25
-#undef PF_X25
+# undef PF_X25
#endif
#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
+# define INADDR_NONE 0xffffffff
#endif /* INADDR_NONE */
#ifndef INADDR_BROADCAST
-#define INADDR_BROADCAST 0xffffffff
+# define INADDR_BROADCAST 0xffffffff
#endif /* INADDR_BROADCAST */
#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7F000001
+# define INADDR_LOOPBACK 0x7F000001
#endif /* INADDR_LOOPBACK */
#ifndef HAS_INET_ATON
diff --git a/global.sym b/global.sym
index 1e739bc773..44417d9444 100644
--- a/global.sym
+++ b/global.sym
@@ -311,6 +311,7 @@ my_bzero
my_chsize
my_exit
my_failure_exit
+my_fflush_all
my_htonl
my_lstat
my_memcmp
diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh
index 4ab535d005..fd7f479d2a 100644
--- a/hints/dec_osf.sh
+++ b/hints/dec_osf.sh
@@ -149,10 +149,19 @@ case "`uname -r`" in
*) if $test "X$optimize" = "X$undef"; then
lddlflags="$lddlflags -msym"
else
- lddlflags="$lddlflags $optimize -msym"
+ case "`sizer -v`" in
+ *4.0D*)
+ # QAR 56761: -O4 + .so may produce broken code,
+ # fixed in 4.0E or better.
+ ;;
+ *)
+ lddlflags="$lddlflags $optimize"
+ ;;
+ esac
+ # -msym: If using a sufficiently recent /sbin/loader,
+ # keep the module symbols with the modules.
+ lddlflags="$lddlflags -msym"
fi
- # -msym: If using a sufficiently recent /sbin/loader,
- # keep the module symbols with the modules.
;;
esac
# Yes, the above loses if gcc does not use the system linker.
diff --git a/objXSUB.h b/objXSUB.h
index 0305bf00cf..f037d3a497 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -1619,6 +1619,8 @@
#define my_exit_jump pPerl->Perl_my_exit_jump
#undef my_failure_exit
#define my_failure_exit pPerl->Perl_my_failure_exit
+#undef my_fflush_all
+#define my_fflush_all pPerl->Perl_my_fflush_all
#undef my_htonl
#define my_htonl pPerl->Perl_my_htonl
#undef my_lstat
diff --git a/perl.h b/perl.h
index 580eb6cddd..e9eb909785 100644
--- a/perl.h
+++ b/perl.h
@@ -502,6 +502,12 @@ Free_t Perl_mfree _((Malloc_t where));
# endif
#endif
+#ifndef memchr
+# ifndef HAS_MEMCHR
+# define memchr(s,c,n) ninstr((char*)(s), ((char*)(s)) + n, &(c), &(c) + 1)
+# endif
+#endif
+
#ifndef HAS_BCMP
# ifndef bcmp
# define bcmp(s1,s2,l) memcmp(s1,s2,l)
@@ -1455,7 +1461,13 @@ 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(FFLUSH_NULL) || defined(USE_SFIO)
+# define PERL_FLUSHALL_FOR_CHILD PerlIO_flush((PerlIO*)NULL)
+# else
+# ifdef FFLUSH_ALL
+# define PERL_FLUSHALL_FOR_CHILD my_fflush_all()
+# endif
+# endif
#endif
/* Some unistd.h's give a prototype for pause() even though
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index b7e2071b41..1213231051 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -202,6 +202,11 @@ if you meant it literally. See L<perlre>.
(F) You had a pack template that specified an absolute position outside
the string being unpacked. See L<perlfunc/pack>.
+=item <> should be quotes
+
+(F) You wrote C<require E<lt>fileE<gt>> when you should have written
+C<require 'file'>.
+
=item accept() on closed fd
(W) You tried to do an accept on a closed socket. Did you forget to check
diff --git a/proto.h b/proto.h
index f2f45a7b9c..ea364f1b62 100644
--- a/proto.h
+++ b/proto.h
@@ -329,6 +329,7 @@ char* my_bzero _((char* loc, I32 len));
#endif
VIRTUAL void my_exit _((U32 status)) __attribute__((noreturn));
VIRTUAL void my_failure_exit _((void)) __attribute__((noreturn));
+VIRTUAL I32 my_fflush_all _((void));
VIRTUAL I32 my_lstat _((ARGSproto));
#if !defined(HAS_MEMCMP) || !defined(HAS_SANE_MEMCMP)
VIRTUAL I32 my_memcmp _((const char* s1, const char* s2, I32 len));
diff --git a/util.c b/util.c
index 740fd99351..d9076d8db9 100644
--- a/util.c
+++ b/util.c
@@ -3195,3 +3195,37 @@ get_vtbl(int vtbl_id)
return result;
}
+I32
+my_fflush_all(void)
+{
+#ifdef FFLUSH_NULL
+ return fflush(NULL);
+#else
+ long open_max = -1;
+# if defined(FFLUSH_ALL) && defined(HAS_STDIO_STREAM_ARRAY)
+# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+ open_max = sysconf(_SC_OPEN_MAX);
+# else
+# ifdef FOPEN_MAX
+# open_max = FOPEN_MAX;
+# else
+# ifdef OPEN_MAX
+# open_max = OPEN_MAX;
+# else
+# ifdef _NFILE
+# open_max = _NFILE;
+# endif
+# endif
+# endif
+# endif
+ if (open_max > 0) {
+ long i;
+ for (i = 0; i < open_max; i++)
+ fflush(&STDIO_STREAM_ARRAY[i]);
+ return 0;
+ }
+# endif
+ SETERRNO(EBADF,RMS$_IFI);
+ return EOF;
+#endif
+}