diff options
-rwxr-xr-x | Configure | 22 | ||||
-rw-r--r-- | reentr.h | 74 | ||||
-rw-r--r-- | reentr.pl | 23 |
3 files changed, 63 insertions, 56 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Thu Mar 21 20:56:19 EET 2002 [metaconfig 3.0 PL70] +# Generated on Fri Mar 22 17:58:57 EET 2002 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <<EOF @@ -10009,7 +10009,7 @@ set ctermid_r d_ctermid_r eval $inlibc case "$d_ctermid_r" in "$define") - hdrs="$i_systypes sys/types.h define stdio.h $i_stdio stdio.h" + hdrs="$i_systypes sys/types.h define stdio.h " case "stdio" in time) hdrs="$hdrs $i_systime sys/time.h" @@ -10595,11 +10595,11 @@ case "$d_endhostent_r" in define) case "$endhostent_r_proto" in ''|0) try='int endhostent_r(struct hostent_data*);' - ./protochk "extern $try" $hdrs && endhostent_r_proto=I_S ;; + ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;; esac case "$endhostent_r_proto" in ''|0) try='void endhostent_r(struct hostent_data*);' - ./protochk "extern $try" $hdrs && endhostent_r_proto=V_S ;; + ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;; esac case "$endhostent_r_proto" in ''|0) d_endhostent_r=undef @@ -10649,11 +10649,11 @@ case "$d_endnetent_r" in define) case "$endnetent_r_proto" in ''|0) try='int endnetent_r(struct netent_data*);' - ./protochk "extern $try" $hdrs && endnetent_r_proto=I_S ;; + ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;; esac case "$endnetent_r_proto" in ''|0) try='void endnetent_r(struct netent_data*);' - ./protochk "extern $try" $hdrs && endnetent_r_proto=V_S ;; + ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;; esac case "$endnetent_r_proto" in ''|0) d_endnetent_r=undef @@ -10703,11 +10703,11 @@ case "$d_endprotoent_r" in define) case "$endprotoent_r_proto" in ''|0) try='int endprotoent_r(struct protoent_data*);' - ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_S ;; + ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;; esac case "$endprotoent_r_proto" in ''|0) try='void endprotoent_r(struct protoent_data*);' - ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_S ;; + ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;; esac case "$endprotoent_r_proto" in ''|0) d_endprotoent_r=undef @@ -10899,11 +10899,11 @@ case "$d_endservent_r" in define) case "$endservent_r_proto" in ''|0) try='int endservent_r(struct servent_data*);' - ./protochk "extern $try" $hdrs && endservent_r_proto=I_S ;; + ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;; esac case "$endservent_r_proto" in ''|0) try='void endservent_r(struct servent_data*);' - ./protochk "extern $try" $hdrs && endservent_r_proto=V_S ;; + ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;; esac case "$endservent_r_proto" in ''|0) d_endservent_r=undef @@ -16211,7 +16211,7 @@ set tmpnam_r d_tmpnam_r eval $inlibc case "$d_tmpnam_r" in "$define") - hdrs="$i_systypes sys/types.h define stdio.h $i_stdio stdio.h" + hdrs="$i_systypes sys/types.h define stdio.h " case "stdio" in time) hdrs="$hdrs $i_systime sys/time.h" @@ -108,20 +108,20 @@ #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_D 23 +#define REENTRANT_PROTO_I_H 24 +#define REENTRANT_PROTO_I_IBI 25 +#define REENTRANT_PROTO_I_IBW 26 +#define REENTRANT_PROTO_I_ICBI 27 +#define REENTRANT_PROTO_I_ICSBWR 28 +#define REENTRANT_PROTO_I_ICSD 29 +#define REENTRANT_PROTO_I_ID 30 +#define REENTRANT_PROTO_I_IISD 31 +#define REENTRANT_PROTO_I_ISBWR 32 +#define REENTRANT_PROTO_I_ISD 33 +#define REENTRANT_PROTO_I_LISBI 34 +#define REENTRANT_PROTO_I_LISD 35 +#define REENTRANT_PROTO_I_LS 36 #define REENTRANT_PROTO_I_SB 37 #define REENTRANT_PROTO_I_SBI 38 #define REENTRANT_PROTO_I_SBIE 39 @@ -156,9 +156,9 @@ #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 +#define REENTRANT_PROTO_V_D 71 +#define REENTRANT_PROTO_V_H 72 +#define REENTRANT_PROTO_V_ID 73 /* Defines for indicating which special features are supported. */ @@ -604,7 +604,7 @@ typedef struct { #ifdef HAS_GETHOSTBYNAME_R struct hostent _gethostent_struct; # if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD - struct hostent_data* _gethostent_data; + struct hostent_data _gethostent_data; # else char* _gethostent_buffer; size_t _gethostent_size; @@ -623,7 +623,7 @@ typedef struct { #ifdef HAS_GETNETBYNAME_R struct netent _getnetent_struct; # if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD - struct netent_data* _getnetent_data; + struct netent_data _getnetent_data; # else char* _getnetent_buffer; size_t _getnetent_size; @@ -638,7 +638,7 @@ typedef struct { #ifdef HAS_GETPROTOBYNAME_R struct protoent _getprotoent_struct; # if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD - struct protoent_data* _getprotoent_data; + struct protoent_data _getprotoent_data; # else char* _getprotoent_buffer; size_t _getprotoent_size; @@ -664,7 +664,7 @@ typedef struct { #ifdef HAS_GETSERVBYNAME_R struct servent _getservent_struct; # if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD - struct servent_data* _getservent_data; + struct servent_data _getservent_data; # else char* _getservent_buffer; size_t _getservent_size; @@ -792,31 +792,31 @@ typedef struct { #ifdef HAS_ENDHOSTENT_R # undef endhostent -# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_S -# define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_struct))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0) +# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_D +# define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0) # endif -# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_S -# define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_struct) +# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_D +# define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_data) # endif #endif /* HAS_ENDHOSTENT_R */ #ifdef HAS_ENDNETENT_R # undef endnetent -# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_S -# define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_struct))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0) +# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_D +# define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0) # endif -# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_S -# define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_struct) +# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_D +# define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_data) # endif #endif /* HAS_ENDNETENT_R */ #ifdef HAS_ENDPROTOENT_R # undef endprotoent -# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_S -# define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0) +# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_D +# define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0) # endif -# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_S -# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct) +# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_D +# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_data) # endif #endif /* HAS_ENDPROTOENT_R */ @@ -832,11 +832,11 @@ typedef struct { #ifdef HAS_ENDSERVENT_R # undef endservent -# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_S -# define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_struct))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0) +# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_D +# define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0) # endif -# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_S -# define endservent() endservent_r(&PL_reentrant_buffer->_getservent_struct) +# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_D +# define endservent() endservent_r(&PL_reentrant_buffer->_getservent_data) # endif #endif /* HAS_ENDSERVENT_R */ @@ -161,7 +161,14 @@ while (<DATA>) { if ($opts{U} && open(U, ">d_${f}_r.U")) { select U; } - my $prereqh = $h eq 'stdio' ? '' : "i_$h"; # There's no i_stdio. + my $prereqs = ''; + my $prereqh = ''; + my $prereqsh = ''; + if ($h ne 'stdio') { # There's no i_stdio. + $prereqs = "i_$h"; + $prereqh = "$h.h"; + $prereqsh = "\$$prereqs $prereqh"; + } print <<EOF if $opts{U}; ?RCS: \$Id: d_${f}_r.U,v $ ?RCS: @@ -172,7 +179,7 @@ while (<DATA>) { ?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 $prereqh usethreads +?MAKE:d_${f}_r ${f}_r_proto: Inlibc Protochk Hasproto i_systypes i_systime $prereqs usethreads ?MAKE: -pick add \$@ %< ?S:d_${f}_r: ?S: This variable conditionally defines the HAS_${F}_R symbol, @@ -200,7 +207,7 @@ set ${f}_r d_${f}_r eval \$inlibc case "\$d_${f}_r" in "\$define") - hdrs="\$i_systypes sys/types.h define stdio.h \$i_${h} $h.h" + hdrs="\$i_systypes sys/types.h define stdio.h $prereqsh" case "$h" in time) hdrs="\$hdrs \$i_systime sys/time.h" @@ -488,6 +495,7 @@ EOF my $G = uc $g; my $D = ifprotomatch($F, grep {/D/} @p); my $d = $seend{$f}; + $d =~ s/\*$//; # snip: we need need the base type. push @struct, <<EOF; $seent{$f} _${g}_struct; # if $D @@ -548,7 +556,6 @@ EOF push @wrap, $ifdef; -# Doesn't implement the buffer growth loop for glibc gethostby*(). push @wrap, <<EOF; # undef $f EOF @@ -898,11 +905,11 @@ 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* endgrent |grp | |I_H|V_H -endhostent |netdb |struct hostent_data |I_S|V_S -endnetent |netdb |struct netent_data |I_S|V_S -endprotoent |netdb |struct protoent_data |I_S|V_S +endhostent |netdb | |I_D|V_D|D=struct hostent_data* +endnetent |netdb | |I_D|V_D|D=struct netent_data* +endprotoent |netdb | |I_D|V_D|D=struct protoent_data* endpwent |pwd | |I_H|V_H -endservent |netdb |struct servent_data |I_S|V_S +endservent |netdb | |I_D|V_D|D=struct servent_data* getgrent |grp |struct group |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH getgrgid T |grp |struct group |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=gid_t getgrnam C |grp |struct group |I_CSBWR|I_CSBIR|S_CBI|I_CSBI|S_CSBI |