diff options
author | David Mitchell <davem@iabyn.com> | 2018-12-26 12:58:06 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-02-19 13:28:12 +0000 |
commit | 999d65ede909a162fb0accd370ffdf1411e94d5e (patch) | |
tree | f729bec46a0a745f8f178d03aae29602da4aa014 /embedvar.h | |
parent | 4ef8bdf9dc2018cb385cf00d11e2e74f0491f8e9 (diff) | |
download | perl-999d65ede909a162fb0accd370ffdf1411e94d5e.tar.gz |
foo_cloexec() under PERL_GLOBAL_STRUCT_PRIVATE
Fix the various Perl_PerlSock_dup2_cloexec() type functions so that
t/porting/liberl.a passes under -DPERL_GLOBAL_STRUCT_PRIVATE builds.
In these builds it is forbidden to have any static variables, but each
of these functions (via convoluted macros) has a static var called
'strategy' which records, for each function, whether a run-time probe
has been done to determine the best way of achieving close-exec
functionality, and the result.
Replace them all with 'global' vars: PL_strategy_dup2 etc.
NB these vars aren't thread-safe but it doesn't really matter, as the
worst that can happen is for a redundant probe or two to be done before
a suitable "don't probe any more" value is written to the var and seen
by all the threads.
Diffstat (limited to 'embedvar.h')
-rw-r--r-- | embedvar.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/embedvar.h b/embedvar.h index 705be5ddf2..37e4ab1600 100644 --- a/embedvar.h +++ b/embedvar.h @@ -460,6 +460,24 @@ #define PL_Gsig_trapped (my_vars->Gsig_trapped) #define PL_sigfpe_saved (my_vars->Gsigfpe_saved) #define PL_Gsigfpe_saved (my_vars->Gsigfpe_saved) +#define PL_strategy_accept (my_vars->Gstrategy_accept) +#define PL_Gstrategy_accept (my_vars->Gstrategy_accept) +#define PL_strategy_dup (my_vars->Gstrategy_dup) +#define PL_Gstrategy_dup (my_vars->Gstrategy_dup) +#define PL_strategy_dup2 (my_vars->Gstrategy_dup2) +#define PL_Gstrategy_dup2 (my_vars->Gstrategy_dup2) +#define PL_strategy_mkstemp (my_vars->Gstrategy_mkstemp) +#define PL_Gstrategy_mkstemp (my_vars->Gstrategy_mkstemp) +#define PL_strategy_open (my_vars->Gstrategy_open) +#define PL_Gstrategy_open (my_vars->Gstrategy_open) +#define PL_strategy_open3 (my_vars->Gstrategy_open3) +#define PL_Gstrategy_open3 (my_vars->Gstrategy_open3) +#define PL_strategy_pipe (my_vars->Gstrategy_pipe) +#define PL_Gstrategy_pipe (my_vars->Gstrategy_pipe) +#define PL_strategy_socket (my_vars->Gstrategy_socket) +#define PL_Gstrategy_socket (my_vars->Gstrategy_socket) +#define PL_strategy_socketpair (my_vars->Gstrategy_socketpair) +#define PL_Gstrategy_socketpair (my_vars->Gstrategy_socketpair) #define PL_sv_placeholder (my_vars->Gsv_placeholder) #define PL_Gsv_placeholder (my_vars->Gsv_placeholder) #define PL_thr_key (my_vars->Gthr_key) |