summaryrefslogtreecommitdiff
path: root/reentr.pl
diff options
context:
space:
mode:
authorSlaven Rezic <slaven@rezic.de>2002-03-22 19:30:36 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-22 17:06:42 +0000
commit8695fa85941db62ef4feecb099bf28f3fd301f51 (patch)
tree9b82d4ea566b00186b22c69326c4d3ff1643928a /reentr.pl
parent95f965eedcb8ab636ae3bd279fa11943aa18e44c (diff)
downloadperl-8695fa85941db62ef4feecb099bf28f3fd301f51.tar.gz
check sysconf's return value in reentr.c
Message-Id: <20020322173246.SOLG27460.mailoutvl21@[192.168.139.30]> (plus use 4k instead 2k as the "usual" size) p4raw-id: //depot/perl@15423
Diffstat (limited to 'reentr.pl')
-rw-r--r--reentr.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/reentr.pl b/reentr.pl
index caee5010cf..ef9a7a1113 100644
--- a/reentr.pl
+++ b/reentr.pl
@@ -404,7 +404,7 @@ for my $f (@seenf) {
size_t _${f}_size;
EOF
push @size, <<EOF;
- PL_reentrant_buffer->_${f}_size = 256; /* Make something up. */
+ PL_reentrant_buffer->_${f}_size = REENTRANTSMALLSIZE;
EOF
pushinitfree $f;
pushssif $endif;
@@ -472,6 +472,8 @@ EOF
push @size, <<EOF;
# if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
PL_reentrant_buffer->_${g}_size = sysconf($sc);
+ if (PL_reentrant_buffer->_getgrent_size == -1)
+ PL_reentrant_buffer->_getgrent_size = REENTRANTUSUALSIZE;
# else
# if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
PL_reentrant_buffer->_${g}_size = SIABUFSIZ;
@@ -479,7 +481,7 @@ EOF
# ifdef __sgi
PL_reentrant_buffer->_${g}_size = BUFSIZ;
# else
- PL_reentrant_buffer->_${g}_size = 256;
+ PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
# endif
# endif
# endif
@@ -515,7 +517,7 @@ EOF
EOF
push @size, <<EOF;
#if !($D)
- PL_reentrant_buffer->_${g}_size = 2048; /* Any better ideas? */
+ PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
#endif
EOF
push @init, <<EOF;
@@ -691,6 +693,8 @@ print <<EOF;
void
Perl_reentrant_size(pTHX) {
#ifdef USE_REENTRANT_API
+#define REENTRANTSMALLSIZE 256 /* Make something up. */
+#define REENTRANTUSUALSIZE 4096 /* Make something up. */
@size
#endif /* USE_REENTRANT_API */
}