diff options
author | Slaven Rezic <slaven@rezic.de> | 2002-03-22 19:30:36 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-22 17:06:42 +0000 |
commit | 8695fa85941db62ef4feecb099bf28f3fd301f51 (patch) | |
tree | 9b82d4ea566b00186b22c69326c4d3ff1643928a /reentr.pl | |
parent | 95f965eedcb8ab636ae3bd279fa11943aa18e44c (diff) | |
download | perl-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.pl | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 */ } |