?S:.
?S:${func}_r_proto:
?S: This variable encodes the prototype of ${func}_r.
+?S: It is zero if d_${func}_r is undef, and one of the
+?S: REENTRANT_PROTO_T_ABC macros of reentr.h if d_${func}_r
+?S: is defined.
?S:.
?C:HAS_${FUNC}_R:
?C: This symbol, if defined, indicates that the ${func}_r routine
?C:.
?C:${FUNC}_R_PROTO:
?C: This symbol encodes the prototype of ${func}_r.
+?C: It is zero if d_${func}_r is undef, and one of the
+?C: REENTRANT_PROTO_T_ABC macros of reentr.h if d_${func}_r
+?C: is defined.
?C:.
?H:#\$d_${func}_r HAS_${FUNC}_R /**/
?H:#define ${FUNC}_R_PROTO \$${func}_r_proto /**/
push @init, <<EOF;
#ifdef __GLIBC__
PL_reentrant_buffer->_${func}_struct.initialized = 0;
+ /* work around glibc-2.2.5 bug */
+ PL_reentrant_buffer->_${func}_struct.current_saltbits = 0;
#endif
EOF
pushssif $endif;
va_start(ap, f);
-#define REENTRANTHALFMAXSIZE 32768 /* The maximum may end up twice this. */
-
switch (PL_op->op_type) {
#ifdef USE_HOSTENT_BUFFER
case OP_GHBYADDR:
case OP_GHBYNAME:
case OP_GHOSTENT:
{
- if (PL_reentrant_buffer->_hostent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_hostent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
PL_reentrant_buffer->_hostent_size *= 2;
Renew(PL_reentrant_buffer->_hostent_buffer,
PL_reentrant_buffer->_hostent_size, char);
case OP_GGRGID:
case OP_GGRENT:
{
- if (PL_reentrant_buffer->_grent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_grent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
Gid_t gid;
PL_reentrant_buffer->_grent_size *= 2;
Renew(PL_reentrant_buffer->_grent_buffer,
case OP_GNBYNAME:
case OP_GNETENT:
{
- if (PL_reentrant_buffer->_netent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_netent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
Netdb_net_t net;
PL_reentrant_buffer->_netent_size *= 2;
Renew(PL_reentrant_buffer->_netent_buffer,
break;
}
}
+ SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GPWUID:
case OP_GPWENT:
{
- if (PL_reentrant_buffer->_pwent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_pwent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
Uid_t uid;
PL_reentrant_buffer->_pwent_size *= 2;
Renew(PL_reentrant_buffer->_pwent_buffer,
break;
}
}
+ SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GPBYNUMBER:
case OP_GPROTOENT:
{
- if (PL_reentrant_buffer->_protoent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_protoent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
PL_reentrant_buffer->_protoent_size *= 2;
Renew(PL_reentrant_buffer->_protoent_buffer,
PL_reentrant_buffer->_protoent_size, char);
break;
}
}
+ SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GSBYPORT:
case OP_GSERVENT:
{
- if (PL_reentrant_buffer->_servent_size <= REENTRANTHALFMAXSIZE) {
+#ifdef PERL_REENTRANT_MAXSIZE
+ if (PL_reentrant_buffer->_servent_size <=
+ PERL_REENTRANT_MAXSIZE / 2)
+#endif
+ {
PL_reentrant_buffer->_servent_size *= 2;
Renew(PL_reentrant_buffer->_servent_buffer,
PL_reentrant_buffer->_servent_size, char);
break;
}
}
+ SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif