X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.pl;h=13c0c2e47956d8fdb89d73a790dfede285ce222c;hb=e00b64d473c19cddad5bacc2934a3b48e9798c1a;hp=caee5010cf65c53e28657925255f7427bab81663;hpb=31ee0cb7dc5352bfe8a41a2a493a0a48e08aa12e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.pl b/reentr.pl index caee501..13c0c2e 100644 --- a/reentr.pl +++ b/reentr.pl @@ -169,7 +169,8 @@ while () { $prereqh = "$h.h"; $prereqsh = "\$$prereqs $prereqh"; } - print <) { ?RCS: ?RCS: Generated by the reentr.pl from the Perl 5.8 distribution. ?RCS: -?MAKE:d_${f}_r ${f}_r_proto: Inlibc Protochk Hasproto i_systypes i_systime $prereqs usethreads +?MAKE:d_${f}_r ${f}_r_proto: Inlibc Protochk Hasproto i_systypes i_systime $prereqs usethreads i_pthread ?MAKE: -pick add \$@ %< ?S:d_${f}_r: ?S: This variable conditionally defines the HAS_${F}_R symbol, @@ -207,12 +208,13 @@ set ${f}_r d_${f}_r eval \$inlibc case "\$d_${f}_r" in "\$define") - hdrs="\$i_systypes sys/types.h define stdio.h $prereqsh" - case "$h" in - time) - hdrs="\$hdrs \$i_systime sys/time.h" - ;; - esac +EOF + my $hdrs = "\$i_systypes sys/types.h define stdio.h $prereqsh"; + if ($h eq 'time') { + $hdrs .= " \$i_systime sys/time.h"; + } + print <{$p}++; - push @{$seena{$f}}, $p; - $seenp{$p}++; - $seent{$f} = $t; - $seens{$f} = $m{S}; - $seend{$f} = $m{D}; - } - if ($opts{U}) { - print <{$p}++; + push @{$seena{$f}}, $p; + $seenp{$p}++; + $seent{$f} = $t; + $seens{$f} = $m{S}; + $seend{$f} = $m{D}; + } + if ($opts{U}) { + print <_${f}_size = 256; /* Make something up. */ + PL_reentrant_buffer->_${f}_size = REENTRANTSMALLSIZE; EOF pushinitfree $f; pushssif $endif; @@ -441,6 +449,7 @@ EOF pushssif $ifdef; my $g = $f; $g =~ s/nam/ent/g; + $g =~ s/^get//; my $G = uc $g; push @struct, <_${g}_size = sysconf($sc); + if (PL_reentrant_buffer->$sz == -1) + PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) PL_reentrant_buffer->_${g}_size = SIABUFSIZ; @@ -479,7 +492,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 @@ -492,6 +505,7 @@ EOF pushssif $ifdef; my $g = $f; $g =~ s/byname/ent/; + $g =~ s/^get//; my $G = uc $g; my $D = ifprotomatch($F, grep {/D/} @p); my $d = $seend{$f}; @@ -515,7 +529,7 @@ EOF EOF push @size, <_${g}_size = 2048; /* Any better ideas? */ + PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE; #endif EOF push @init, <op_type) { -#ifdef USE_GETHOSTENT_BUFFER +#ifdef USE_HOSTENT_BUFFER case OP_GHBYADDR: case OP_GHBYNAME: case OP_GHOSTENT: { - if (PL_reentrant_buffer->_gethostent_size <= REENTRANTHALFMAXSIZE) { - PL_reentrant_buffer->_gethostent_size *= 2; - Renew(PL_reentrant_buffer->_gethostent_buffer, - PL_reentrant_buffer->_gethostent_size, char); + if (PL_reentrant_buffer->_hostent_size <= REENTRANTHALFMAXSIZE) { + PL_reentrant_buffer->_hostent_size *= 2; + Renew(PL_reentrant_buffer->_hostent_buffer, + PL_reentrant_buffer->_hostent_size, char); switch (PL_op->op_type) { case OP_GHBYADDR: p0 = va_arg(ap, void *); @@ -755,16 +780,16 @@ Perl_reentrant_retry(const char *f, ...) } break; #endif -#ifdef USE_GETGRENT_BUFFER +#ifdef USE_GRENT_BUFFER case OP_GGRNAM: case OP_GGRGID: case OP_GGRENT: { - if (PL_reentrant_buffer->_getgrent_size <= REENTRANTHALFMAXSIZE) { + if (PL_reentrant_buffer->_grent_size <= REENTRANTHALFMAXSIZE) { Gid_t gid; - PL_reentrant_buffer->_getgrent_size *= 2; - Renew(PL_reentrant_buffer->_getgrent_buffer, - PL_reentrant_buffer->_getgrent_size, char); + PL_reentrant_buffer->_grent_size *= 2; + Renew(PL_reentrant_buffer->_grent_buffer, + PL_reentrant_buffer->_grent_size, char); switch (PL_op->op_type) { case OP_GGRNAM: p0 = va_arg(ap, void *); @@ -781,16 +806,16 @@ Perl_reentrant_retry(const char *f, ...) } break; #endif -#ifdef USE_GETNETENT_BUFFER +#ifdef USE_NETENT_BUFFER case OP_GNBYADDR: case OP_GNBYNAME: case OP_GNETENT: { - if (PL_reentrant_buffer->_getnetent_size <= REENTRANTHALFMAXSIZE) { + if (PL_reentrant_buffer->_netent_size <= REENTRANTHALFMAXSIZE) { Netdb_net_t net; - PL_reentrant_buffer->_getnetent_size *= 2; - Renew(PL_reentrant_buffer->_getnetent_buffer, - PL_reentrant_buffer->_getnetent_size, char); + PL_reentrant_buffer->_netent_size *= 2; + Renew(PL_reentrant_buffer->_netent_buffer, + PL_reentrant_buffer->_netent_size, char); switch (PL_op->op_type) { case OP_GNBYADDR: net = va_arg(ap, Netdb_net_t); @@ -808,16 +833,16 @@ Perl_reentrant_retry(const char *f, ...) } break; #endif -#ifdef USE_GETPWENT_BUFFER +#ifdef USE_PWENT_BUFFER case OP_GPWNAM: case OP_GPWUID: case OP_GPWENT: { - if (PL_reentrant_buffer->_getpwent_size <= REENTRANTHALFMAXSIZE) { + if (PL_reentrant_buffer->_pwent_size <= REENTRANTHALFMAXSIZE) { Uid_t uid; - PL_reentrant_buffer->_getpwent_size *= 2; - Renew(PL_reentrant_buffer->_getpwent_buffer, - PL_reentrant_buffer->_getpwent_size, char); + PL_reentrant_buffer->_pwent_size *= 2; + Renew(PL_reentrant_buffer->_pwent_buffer, + PL_reentrant_buffer->_pwent_size, char); switch (PL_op->op_type) { case OP_GPWNAM: p0 = va_arg(ap, void *); @@ -834,15 +859,15 @@ Perl_reentrant_retry(const char *f, ...) } break; #endif -#ifdef USE_GETPROTOENT_BUFFER +#ifdef USE_PROTOENT_BUFFER case OP_GPBYNAME: case OP_GPBYNUMBER: case OP_GPROTOENT: { - if (PL_reentrant_buffer->_getprotoent_size <= REENTRANTHALFMAXSIZE) { - PL_reentrant_buffer->_getprotoent_size *= 2; - Renew(PL_reentrant_buffer->_getprotoent_buffer, - PL_reentrant_buffer->_getprotoent_size, char); + if (PL_reentrant_buffer->_protoent_size <= REENTRANTHALFMAXSIZE) { + PL_reentrant_buffer->_protoent_size *= 2; + Renew(PL_reentrant_buffer->_protoent_buffer, + PL_reentrant_buffer->_protoent_size, char); switch (PL_op->op_type) { case OP_GPBYNAME: p0 = va_arg(ap, void *); @@ -859,15 +884,15 @@ Perl_reentrant_retry(const char *f, ...) } break; #endif -#ifdef USE_GETSERVENT_BUFFER +#ifdef USE_SERVENT_BUFFER case OP_GSBYNAME: case OP_GSBYPORT: case OP_GSERVENT: { - if (PL_reentrant_buffer->_getservent_size <= REENTRANTHALFMAXSIZE) { - PL_reentrant_buffer->_getservent_size *= 2; - Renew(PL_reentrant_buffer->_getservent_buffer, - PL_reentrant_buffer->_getservent_size, char); + if (PL_reentrant_buffer->_servent_size <= REENTRANTHALFMAXSIZE) { + PL_reentrant_buffer->_servent_size *= 2; + Renew(PL_reentrant_buffer->_servent_buffer, + PL_reentrant_buffer->_servent_size, char); switch (PL_op->op_type) { case OP_GSBYNAME: p0 = va_arg(ap, void *);