#ifdef HAS_DRAND48_R
#endif /* HAS_DRAND48_R */
#ifdef HAS_GETGRNAM_R
-# if defined(HAS_SYSCONF) && defined(_SC_GETPW_R_SIZE_MAX) && !defined(__GLIBC__)
- PL_reentrant_buffer->_grent_size = sysconf(_SC_GETPW_R_SIZE_MAX);
- if (PL_reentrant_buffer->_pwent_size == -1)
- PL_reentrant_buffer->_pwent_size = REENTRANTUSUALSIZE;
+# if defined(HAS_SYSCONF) && defined(_SC_GETGR_R_SIZE_MAX) && !defined(__GLIBC__)
+ PL_reentrant_buffer->_grent_size = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (PL_reentrant_buffer->_grent_size == -1)
+ PL_reentrant_buffer->_grent_size = REENTRANTUSUALSIZE;
# else
# if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
PL_reentrant_buffer->_grent_size = SIABUFSIZ;
#ifdef HAS_GETSPNAM_R
# if defined(HAS_SYSCONF) && defined(_SC_GETPW_R_SIZE_MAX) && !defined(__GLIBC__)
PL_reentrant_buffer->_spent_size = sysconf(_SC_GETPW_R_SIZE_MAX);
- if (PL_reentrant_buffer->_pwent_size == -1)
- PL_reentrant_buffer->_pwent_size = REENTRANTUSUALSIZE;
+ if (PL_reentrant_buffer->_spent_size == -1)
+ PL_reentrant_buffer->_spent_size = REENTRANTUSUALSIZE;
# else
# if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
PL_reentrant_buffer->_spent_size = SIABUFSIZ;
case OP_GHOSTENT:
retptr = gethostent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GGRENT:
retptr = getgrent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GNETENT:
retptr = getnetent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GPWENT:
retptr = getpwent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
case OP_GPROTOENT:
retptr = getprotoent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GSERVENT:
retptr = getservent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
$seent{$func}* _${genfunc}_ptr;
# endif
EOF
- if ($genfunc eq 'getspent') {
- push @size, <<EOF;
- PL_reentrant_buffer->_${genfunc}_size = 1024;
-EOF
- } else {
- push @struct, <<EOF;
+ push @struct, <<EOF;
# ifdef USE_${GENFUNC}_FPTR
FILE* _${genfunc}_fptr;
# endif
EOF
- push @init, <<EOF;
+ push @init, <<EOF;
# ifdef USE_${GENFUNC}_FPTR
PL_reentrant_buffer->_${genfunc}_fptr = NULL;
# endif
EOF
- my $sc = $genfunc eq 'getgrent' ?
+ my $sc = $genfunc eq 'grent' ?
'_SC_GETGR_R_SIZE_MAX' : '_SC_GETPW_R_SIZE_MAX';
- my $sz = $genfunc eq 'getgrent' ?
- '_grent_size' : '_pwent_size';
- push @size, <<EOF;
+ my $sz = "_${genfunc}_size";
+ push @size, <<EOF;
# if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
- PL_reentrant_buffer->_${genfunc}_size = sysconf($sc);
+ PL_reentrant_buffer->$sz = sysconf($sc);
if (PL_reentrant_buffer->$sz == -1)
PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
# else
# if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
- PL_reentrant_buffer->_${genfunc}_size = SIABUFSIZ;
+ PL_reentrant_buffer->$sz = SIABUFSIZ;
# else
# ifdef __sgi
- PL_reentrant_buffer->_${genfunc}_size = BUFSIZ;
+ PL_reentrant_buffer->$sz = BUFSIZ;
# else
- PL_reentrant_buffer->_${genfunc}_size = REENTRANTUSUALSIZE;
+ PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
# endif
# endif
# endif
EOF
- }
pushinitfree $genfunc;
pushssif $endif;
}
case OP_GHOSTENT:
retptr = gethostent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
case OP_GGRENT:
retptr = getgrent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
case OP_GNETENT:
retptr = getnetent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GPWENT:
retptr = getpwent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GPROTOENT:
retptr = getprotoent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif
case OP_GSERVENT:
retptr = getservent(); break;
default:
+ SETERRNO(ERANGE, LIB_INVARG);
break;
}
}
- SETERRNO(ERANGE, LIB_INVARG);
}
break;
#endif