diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-19 15:16:43 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-19 15:16:43 +0000 |
commit | b430fd0465bf67481688d8bedfceb885abf2a170 (patch) | |
tree | 404da1135b0afd4c5e0b871d58c51c913b1a325c | |
parent | 8b2eb6baf3a025e29d66405a3bae06e917411ea9 (diff) | |
download | perl-b430fd0465bf67481688d8bedfceb885abf2a170.tar.gz |
Support crypt_r(const char*,const char*, CRYPTD*).
p4raw-id: //depot/perl@15326
-rwxr-xr-x | Configure | 6 | ||||
-rw-r--r-- | reentr.h | 146 | ||||
-rw-r--r-- | reentr.pl | 19 |
3 files changed, 96 insertions, 75 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Mar 18 16:52:30 EET 2002 [metaconfig 3.0 PL70] +# Generated on Tue Mar 19 18:17:12 EET 2002 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <<EOF @@ -9949,6 +9949,10 @@ case "$d_crypt_r" in ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;; esac case "$crypt_r_proto" in + ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);' + ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;; + esac + case "$crypt_r_proto" in '') d_crypt_r=undef crypt_r_proto=0 echo "Disabling crypt_r, cannot determine prototype." >&4 ;; @@ -89,75 +89,76 @@ #define REENTRANT_PROTO_B_B 1 #define REENTRANT_PROTO_B_BI 2 #define REENTRANT_PROTO_B_BW 3 -#define REENTRANT_PROTO_B_CCS 4 -#define REENTRANT_PROTO_B_IBI 5 -#define REENTRANT_PROTO_B_IBW 6 -#define REENTRANT_PROTO_B_SB 7 -#define REENTRANT_PROTO_B_SBI 8 -#define REENTRANT_PROTO_I_BI 9 -#define REENTRANT_PROTO_I_BW 10 -#define REENTRANT_PROTO_I_CCSBWR 11 -#define REENTRANT_PROTO_I_CCSD 12 -#define REENTRANT_PROTO_I_CII 13 -#define REENTRANT_PROTO_I_CIISD 14 -#define REENTRANT_PROTO_I_CSBI 15 -#define REENTRANT_PROTO_I_CSBIR 16 -#define REENTRANT_PROTO_I_CSBWR 17 -#define REENTRANT_PROTO_I_CSBWRE 18 -#define REENTRANT_PROTO_I_CSD 19 -#define REENTRANT_PROTO_I_CWISBWRE 20 -#define REENTRANT_PROTO_I_CWISD 21 -#define REENTRANT_PROTO_I_H 22 -#define REENTRANT_PROTO_I_IBI 23 -#define REENTRANT_PROTO_I_IBW 24 -#define REENTRANT_PROTO_I_ICBI 25 -#define REENTRANT_PROTO_I_ICSBWR 26 -#define REENTRANT_PROTO_I_ICSD 27 -#define REENTRANT_PROTO_I_ID 28 -#define REENTRANT_PROTO_I_IISD 29 -#define REENTRANT_PROTO_I_ISBWR 30 -#define REENTRANT_PROTO_I_ISD 31 -#define REENTRANT_PROTO_I_LISBI 32 -#define REENTRANT_PROTO_I_LISD 33 -#define REENTRANT_PROTO_I_LS 34 -#define REENTRANT_PROTO_I_S 35 -#define REENTRANT_PROTO_I_SB 36 -#define REENTRANT_PROTO_I_SBI 37 -#define REENTRANT_PROTO_I_SBIE 38 -#define REENTRANT_PROTO_I_SBIH 39 -#define REENTRANT_PROTO_I_SBIR 40 -#define REENTRANT_PROTO_I_SBWR 41 -#define REENTRANT_PROTO_I_SBWRE 42 -#define REENTRANT_PROTO_I_SD 43 -#define REENTRANT_PROTO_I_ST 44 -#define REENTRANT_PROTO_I_TISD 45 -#define REENTRANT_PROTO_I_TS 46 -#define REENTRANT_PROTO_I_TSBI 47 -#define REENTRANT_PROTO_I_TSBIR 48 -#define REENTRANT_PROTO_I_TSBWR 49 -#define REENTRANT_PROTO_I_TSR 50 -#define REENTRANT_PROTO_I_UISBWRE 51 -#define REENTRANT_PROTO_S_CBI 52 -#define REENTRANT_PROTO_S_CCSBI 53 -#define REENTRANT_PROTO_S_CIISBIE 54 -#define REENTRANT_PROTO_S_CSBI 55 -#define REENTRANT_PROTO_S_CSBIE 56 -#define REENTRANT_PROTO_S_CWISBIE 57 -#define REENTRANT_PROTO_S_CWISBWIE 58 -#define REENTRANT_PROTO_S_ICSBI 59 -#define REENTRANT_PROTO_S_ISBI 60 -#define REENTRANT_PROTO_S_LISBI 61 -#define REENTRANT_PROTO_S_SBI 62 -#define REENTRANT_PROTO_S_SBIE 63 -#define REENTRANT_PROTO_S_SBW 64 -#define REENTRANT_PROTO_S_TISBI 65 -#define REENTRANT_PROTO_S_TS 66 -#define REENTRANT_PROTO_S_TSBI 67 -#define REENTRANT_PROTO_S_TSBIE 68 -#define REENTRANT_PROTO_S_TWISBIE 69 -#define REENTRANT_PROTO_V_H 70 -#define REENTRANT_PROTO_V_ID 71 -#define REENTRANT_PROTO_V_S 72 +#define REENTRANT_PROTO_B_CCD 4 +#define REENTRANT_PROTO_B_CCS 5 +#define REENTRANT_PROTO_B_IBI 6 +#define REENTRANT_PROTO_B_IBW 7 +#define REENTRANT_PROTO_B_SB 8 +#define REENTRANT_PROTO_B_SBI 9 +#define REENTRANT_PROTO_I_BI 10 +#define REENTRANT_PROTO_I_BW 11 +#define REENTRANT_PROTO_I_CCSBWR 12 +#define REENTRANT_PROTO_I_CCSD 13 +#define REENTRANT_PROTO_I_CII 14 +#define REENTRANT_PROTO_I_CIISD 15 +#define REENTRANT_PROTO_I_CSBI 16 +#define REENTRANT_PROTO_I_CSBIR 17 +#define REENTRANT_PROTO_I_CSBWR 18 +#define REENTRANT_PROTO_I_CSBWRE 19 +#define REENTRANT_PROTO_I_CSD 20 +#define REENTRANT_PROTO_I_CWISBWRE 21 +#define REENTRANT_PROTO_I_CWISD 22 +#define REENTRANT_PROTO_I_H 23 +#define REENTRANT_PROTO_I_IBI 24 +#define REENTRANT_PROTO_I_IBW 25 +#define REENTRANT_PROTO_I_ICBI 26 +#define REENTRANT_PROTO_I_ICSBWR 27 +#define REENTRANT_PROTO_I_ICSD 28 +#define REENTRANT_PROTO_I_ID 29 +#define REENTRANT_PROTO_I_IISD 30 +#define REENTRANT_PROTO_I_ISBWR 31 +#define REENTRANT_PROTO_I_ISD 32 +#define REENTRANT_PROTO_I_LISBI 33 +#define REENTRANT_PROTO_I_LISD 34 +#define REENTRANT_PROTO_I_LS 35 +#define REENTRANT_PROTO_I_S 36 +#define REENTRANT_PROTO_I_SB 37 +#define REENTRANT_PROTO_I_SBI 38 +#define REENTRANT_PROTO_I_SBIE 39 +#define REENTRANT_PROTO_I_SBIH 40 +#define REENTRANT_PROTO_I_SBIR 41 +#define REENTRANT_PROTO_I_SBWR 42 +#define REENTRANT_PROTO_I_SBWRE 43 +#define REENTRANT_PROTO_I_SD 44 +#define REENTRANT_PROTO_I_ST 45 +#define REENTRANT_PROTO_I_TISD 46 +#define REENTRANT_PROTO_I_TS 47 +#define REENTRANT_PROTO_I_TSBI 48 +#define REENTRANT_PROTO_I_TSBIR 49 +#define REENTRANT_PROTO_I_TSBWR 50 +#define REENTRANT_PROTO_I_TSR 51 +#define REENTRANT_PROTO_I_UISBWRE 52 +#define REENTRANT_PROTO_S_CBI 53 +#define REENTRANT_PROTO_S_CCSBI 54 +#define REENTRANT_PROTO_S_CIISBIE 55 +#define REENTRANT_PROTO_S_CSBI 56 +#define REENTRANT_PROTO_S_CSBIE 57 +#define REENTRANT_PROTO_S_CWISBIE 58 +#define REENTRANT_PROTO_S_CWISBWIE 59 +#define REENTRANT_PROTO_S_ICSBI 60 +#define REENTRANT_PROTO_S_ISBI 61 +#define REENTRANT_PROTO_S_LISBI 62 +#define REENTRANT_PROTO_S_SBI 63 +#define REENTRANT_PROTO_S_SBIE 64 +#define REENTRANT_PROTO_S_SBW 65 +#define REENTRANT_PROTO_S_TISBI 66 +#define REENTRANT_PROTO_S_TS 67 +#define REENTRANT_PROTO_S_TSBI 68 +#define REENTRANT_PROTO_S_TSBIE 69 +#define REENTRANT_PROTO_S_TWISBIE 70 +#define REENTRANT_PROTO_V_H 71 +#define REENTRANT_PROTO_V_ID 72 +#define REENTRANT_PROTO_V_S 73 /* Defines for indicating which special features are supported. */ @@ -575,7 +576,11 @@ typedef struct { size_t _asctime_size; #endif /* HAS_ASCTIME_R */ #ifdef HAS_CRYPT_R +#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD + CRYPTD* _crypt_data; +#else struct crypt_data _crypt_struct; +#endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTIME_R char* _ctime_buffer; @@ -740,6 +745,9 @@ typedef struct { # if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS # define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_struct) # endif +# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD +# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_data) +# endif #endif /* HAS_CRYPT_R */ #ifdef HAS_CTERMID_R @@ -395,18 +395,27 @@ EOF pushinitfree $f; pushssif $endif; } - elsif ($f =~ /^(crypt|drand48|gmtime|localtime|random)$/) { + elsif ($f =~ /^(crypt)$/) { pushssif $ifdef; push @struct, <<EOF; +#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD + $seend{$f} _${f}_data; +#else $seent{$f} _${f}_struct; +#endif EOF - if ($f eq 'crypt') { - push @init, <<EOF; + push @init, <<EOF; #ifdef __GLIBC__ PL_reentrant_buffer->_${f}_struct.initialized = 0; #endif EOF - } + pushssif $endif; + } + elsif ($f =~ /^(drand48|gmtime|localtime|random)$/) { + pushssif $ifdef; + push @struct, <<EOF; + $seent{$f} _${f}_struct; +EOF if ($1 eq 'drand48') { push @struct, <<EOF; double _${f}_double; @@ -877,7 +886,7 @@ EOF __DATA__ asctime S |time |const struct tm|B_SB|B_SBI|I_SB|I_SBI -crypt CC |crypt |struct crypt_data|B_CCS +crypt CC |crypt |struct crypt_data|B_CCS|B_CCD|D=CRYPTD* ctermid B |stdio | |B_B ctime S |time |const time_t |B_SB|B_SBI|I_SB|I_SBI drand48 |stdlib |struct drand48_data |I_ST|T=double* |