XRootD
Loading...
Searching...
No Matches
XrdClDefaultEnv.cc File Reference
#include "XrdCl/XrdClDefaultEnv.hh"
#include "XrdCl/XrdClConstants.hh"
#include "XrdCl/XrdClPostMaster.hh"
#include "XrdCl/XrdClLog.hh"
#include "XrdCl/XrdClForkHandler.hh"
#include "XrdCl/XrdClFileTimer.hh"
#include "XrdCl/XrdClUtils.hh"
#include "XrdCl/XrdClMonitor.hh"
#include "XrdCl/XrdClCheckSumManager.hh"
#include "XrdCl/XrdClTransportManager.hh"
#include "XrdCl/XrdClPlugInManager.hh"
#include "XrdCl/XrdClOptimizers.hh"
#include "XrdOuc/XrdOucPreload.hh"
#include "XrdSys/XrdSysAtomics.hh"
#include "XrdSys/XrdSysUtils.hh"
#include "XrdSys/XrdSysPwd.hh"
#include "XrdVersion.hh"
#include <libgen.h>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
+ Include dependency graph for XrdClDefaultEnv.cc:

Go to the source code of this file.

Namespaces

namespace  XrdCl
 

Macros

#define REGISTER_VAR_INT(array, name, def)
 
#define REGISTER_VAR_STR(array, name, def)
 

Functions

static void child ()
 
static void parent ()
 
static void prepare ()
 
 XrdVERSIONINFO (XrdCl, client)
 

Macro Definition Documentation

◆ REGISTER_VAR_INT

#define REGISTER_VAR_INT ( array,
name,
def )
Value:
array.push_back( EnvVarHolder<int>( name, def ) )

Definition at line 229 of file XrdClDefaultEnv.cc.

229#define REGISTER_VAR_INT( array, name, def ) \
230 array.push_back( EnvVarHolder<int>( name, def ) )

◆ REGISTER_VAR_STR

#define REGISTER_VAR_STR ( array,
name,
def )
Value:
array.push_back( EnvVarHolder<std::string>( name, def ) )

Definition at line 232 of file XrdClDefaultEnv.cc.

232#define REGISTER_VAR_STR( array, name, def ) \
233 array.push_back( EnvVarHolder<std::string>( name, def ) )

Function Documentation

◆ child()

static void child ( )
static

Definition at line 105 of file XrdClDefaultEnv.cc.

106 {
107 using namespace XrdCl;
109 Log *log = DefaultEnv::GetLog();
110 Env *env = DefaultEnv::GetEnv();
112 env->RecreateLock();
113
114 pid_t pid = getpid();
115 log->Debug( UtilityMsg, "In the child fork handler for process %d", pid );
116
117 //--------------------------------------------------------------------------
118 // Run the fork handler if it's enabled
119 //--------------------------------------------------------------------------
120 int runForkHandler = DefaultRunForkHandler;
121 env->GetInt( "RunForkHandler", runForkHandler );
122 if( runForkHandler )
123 {
124 log->SetPid(pid);
125 forkHandler->Child();
126 }
127 }
static Log * GetLog()
Get default log.
static ForkHandler * GetForkHandler()
Get the fork handler.
static Env * GetEnv()
Get default client environment.
static void ReInitializeLogging()
Re-initialize the logging.
void RecreateLock()
Definition XrdClEnv.hh:141
bool GetInt(const std::string &key, int &value)
Definition XrdClEnv.cc:89
void Child()
Handler the child post-fork.
Handle diagnostics.
Definition XrdClLog.hh:101
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Definition XrdClLog.cc:282
void SetPid(pid_t pid)
Set pid.
Definition XrdClLog.hh:267
const int DefaultRunForkHandler
const uint64_t UtilityMsg

References XrdCl::ForkHandler::Child(), XrdCl::Log::Debug(), XrdCl::DefaultRunForkHandler, XrdCl::DefaultEnv::GetEnv(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::Env::RecreateLock(), XrdCl::DefaultEnv::ReInitializeLogging(), XrdCl::Log::SetPid(), and XrdCl::UtilityMsg.

+ Here is the call graph for this function:

◆ parent()

static void parent ( )
static

Definition at line 80 of file XrdClDefaultEnv.cc.

81 {
82 using namespace XrdCl;
83 Log *log = DefaultEnv::GetLog();
84 Env *env = DefaultEnv::GetEnv();
86
87 pid_t pid = getpid();
88 log->Debug( UtilityMsg, "In the parent fork handler for process %d", pid );
89
90 //--------------------------------------------------------------------------
91 // Run the fork handler if it's enabled
92 //--------------------------------------------------------------------------
93 int runForkHandler = DefaultRunForkHandler;
94 env->GetInt( "RunForkHandler", runForkHandler );
95 if( runForkHandler )
96 {
97 log->SetPid(pid);
98 forkHandler->Parent();
99 }
100 }
void Parent()
Handle the parent post-fork.

References XrdCl::Log::Debug(), XrdCl::DefaultRunForkHandler, XrdCl::DefaultEnv::GetEnv(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::ForkHandler::Parent(), XrdCl::Log::SetPid(), and XrdCl::UtilityMsg.

Referenced by XrdPfc::DirState::DirState(), XrdOssCsiDir::XrdOssCsiDir(), XrdOssCsiFile::XrdOssCsiFile(), and XrdCl::DirectoryList::SetParentName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepare()

static void prepare ( )
static

Definition at line 58 of file XrdClDefaultEnv.cc.

59 {
60 using namespace XrdCl;
61 Log *log = DefaultEnv::GetLog();
62 Env *env = DefaultEnv::GetEnv();
64
65 log->Debug( UtilityMsg, "In the prepare fork handler for process %d",
66 getpid() );
67
68 //--------------------------------------------------------------------------
69 // Run the fork handler if it's enabled
70 //--------------------------------------------------------------------------
71 int runForkHandler = DefaultRunForkHandler;
72 env->GetInt( "RunForkHandler", runForkHandler );
73 if( runForkHandler )
74 forkHandler->Prepare();
75 }
void Prepare()
Handle the preparation part of the forking process.

References XrdCl::Log::Debug(), XrdCl::DefaultRunForkHandler, XrdCl::DefaultEnv::GetEnv(), XrdCl::DefaultEnv::GetForkHandler(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::ForkHandler::Prepare(), and XrdCl::UtilityMsg.

+ Here is the call graph for this function:

◆ XrdVERSIONINFO()

XrdVERSIONINFO ( XrdCl ,
client  )