diff options
author | Karl Williamson <khw@cpan.org> | 2020-03-15 14:18:53 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-03-18 18:05:49 -0600 |
commit | e63f5cd52c6c3c1a6bfd3378cba9f99dea62b3b2 (patch) | |
tree | 92011858fd7fa23de8e42e98d71c97c7e4542830 /regen | |
parent | 7dc0f1bb7f6dd199fb0aae6f5edfa264e67a051a (diff) | |
download | perl-e63f5cd52c6c3c1a6bfd3378cba9f99dea62b3b2.tar.gz |
reentr.[ch]: Add gmtime_r, localtime_r
This now replaces occurrences of the non re-entrant versions of these
two functions with the reentrant ones.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/reentr.pl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/regen/reentr.pl b/regen/reentr.pl index 2604d2c8b2..fa961d58f5 100644 --- a/regen/reentr.pl +++ b/regen/reentr.pl @@ -495,6 +495,13 @@ EOF pushinitfree $func; pushssif $endif; } + elsif ($func =~ /^(gm|local)time$/) { + pushssif $ifdef; + push @struct, <<EOF; # Fixed size + $seent{$func} _${func}_struct; +EOF + pushssif $endif; + } elsif ($func =~ /^(crypt)$/) { pushssif $ifdef; push @struct, <<EOF; @@ -689,7 +696,10 @@ EOF $w = ", $w" if length $v; } - my $call = "${func}_r($v$w)"; + # This needs a special case, see its definition in config.h + my $setup = ($func eq 'localtime') ? "L_R_TZSET " : ""; + + my $call = "$setup${func}_r($v$w)"; # Must make OpenBSD happy my $memzero = ''; @@ -1197,6 +1207,8 @@ getservbyname CC|netdb |struct servent |I_CCSBWR|S_CCSBI|I_CCSD|D=struct servent getservbyport IC|netdb |struct servent |I_ICSBWR|S_ICSBI|I_ICSD|D=struct servent_data* getservent |netdb |struct servent |I_SBWR|I_SBI|S_SBI|I_SD|D=struct servent_data* getspnam C |shadow |struct spwd |I_CSBWR|S_CSBI +gmtime T |time |struct tm |S_TS|T=time_t* +localtime T |time |struct tm |S_TS|T=time_t* readdir T |dirent |struct dirent |I_TSR|I_TS|T=DIR* readdir64 T |dirent |struct dirent64|I_TSR|I_TS|T=DIR* setgrent |grp | |I_H|V_H |