X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.c;h=c2972e0e07ccd8e6f2d4699b52a80c332cf603d0;hb=80b46460027bf2bee58a37ec48620576b7519f26;hp=8dddbe766549f493f310a5b0859b8492640196a0;hpb=ab2b559bb5510413385bdf5e5398bcdfb293e40d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.c b/reentr.c index 8dddbe7..c2972e0 100644 --- a/reentr.c +++ b/reentr.c @@ -1,17 +1,23 @@ /* * reentr.c * - * Copyright (c) 1997-2003, Larry Wall + * Copyright (C) 2002, 2003, by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. * * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - * This file is built by reentrl.pl from data in reentr.pl. + * This file is built by reentr.pl from data in reentr.pl. * * "Saruman," I said, standing away from him, "only one hand at a time can * wield the One, and you know that well, so do not trouble to say we!" * + * This file contains a collection of automatically created wrappers + * (created by running reentr.pl) for reentrant (thread-safe) versions of + * various library calls, such as getpwent_r. The wrapping is done so + * that other files like pp_sys.c calling those library functions need not + * care about the differences between various platforms' idiosyncrasies + * regarding these reentrant interfaces. */ #include "EXTERN.h" @@ -127,6 +133,8 @@ Perl_reentrant_size(pTHX) { #ifdef HAS_SETLOCALE_R PL_reentrant_buffer->_setlocale_size = REENTRANTSMALLSIZE; #endif /* HAS_SETLOCALE_R */ +#ifdef HAS_SRANDOM_R +#endif /* HAS_SRANDOM_R */ #ifdef HAS_STRERROR_R PL_reentrant_buffer->_strerror_size = REENTRANTSMALLSIZE; #endif /* HAS_STRERROR_R */ @@ -146,10 +154,8 @@ Perl_reentrant_init(pTHX) { New(31338, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size, char); #endif /* HAS_ASCTIME_R */ #ifdef HAS_CRYPT_R -#ifdef __GLIBC__ - PL_reentrant_buffer->_crypt_struct.initialized = 0; - /* work around glibc-2.2.5 bug */ - PL_reentrant_buffer->_crypt_struct.current_saltbits = 0; +#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD + PL_reentrant_buffer->_crypt_struct_buffer = 0; #endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R @@ -213,6 +219,8 @@ Perl_reentrant_init(pTHX) { #ifdef HAS_SETLOCALE_R New(31338, PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size, char); #endif /* HAS_SETLOCALE_R */ +#ifdef HAS_SRANDOM_R +#endif /* HAS_SRANDOM_R */ #ifdef HAS_STRERROR_R New(31338, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size, char); #endif /* HAS_STRERROR_R */ @@ -230,6 +238,9 @@ Perl_reentrant_free(pTHX) { Safefree(PL_reentrant_buffer->_asctime_buffer); #endif /* HAS_ASCTIME_R */ #ifdef HAS_CRYPT_R +#if CRYPT_R_PROTO != REENTRANT_PROTO_B_CCD + Safefree(PL_reentrant_buffer->_crypt_struct_buffer); +#endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R Safefree(PL_reentrant_buffer->_ctime_buffer); @@ -283,6 +294,8 @@ Perl_reentrant_free(pTHX) { #ifdef HAS_SETLOCALE_R Safefree(PL_reentrant_buffer->_setlocale_buffer); #endif /* HAS_SETLOCALE_R */ +#ifdef HAS_SRANDOM_R +#endif /* HAS_SRANDOM_R */ #ifdef HAS_STRERROR_R Safefree(PL_reentrant_buffer->_strerror_buffer); #endif /* HAS_STRERROR_R */ @@ -300,7 +313,7 @@ Perl_reentrant_retry(const char *f, ...) dTHX; void *retptr = NULL; #ifdef USE_REENTRANT_API -# if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SRVENT_BUFFER) +# if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER) void *p0; # endif # if defined(USE_SERVENT_BUFFER)