ROOT logo
ROOT » CORE » UNIX » TUnixSystem

class TUnixSystem: public TSystem


TUnixSystem

Class providing an interface to the UNIX Operating System.


Function Members (Methods)

public:
TUnixSystem()
virtual~TUnixSystem()
virtual voidAbort(int code = 0)
voidTObject::AbstractMethod(const char* method) const
virtual intAcceptConnection(int sock)
virtual Bool_tAccessPathName(const char* path, EAccessMode mode = kFileExists)
virtual voidAddDynamicPath(const char* lib)
virtual voidAddFileHandler(TFileHandler* fh)
virtual voidTSystem::AddIncludePath(const char* includePath)
virtual voidTSystem::AddLinkedLibs(const char* linkedLib)
virtual voidAddSignalHandler(TSignalHandler* sh)
virtual voidTSystem::AddStdExceptionHandler(TStdExceptionHandler* eh)
virtual voidAddTimer(TTimer* ti)
virtual intAnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1)
virtual intAnnounceUnixService(int port, int backlog)
virtual intAnnounceUnixService(const char* sockpath, int backlog)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual const char*TSystem::BaseName(const char* pathname)
voidTSystem::Beep(Int_t freq = -1, Int_t duration = -1, Bool_t setDefault = kFALSE)
virtual voidTObject::Browse(TBrowser* b)
Bool_tTSystem::cd(const char* path)
virtual Bool_tChangeDirectory(const char* path)
voidCheckChilds()
Bool_tCheckDescriptors()
Bool_tCheckSignals(Bool_t sync)
virtual intChmod(const char* file, UInt_t mode)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTSystem::CleanCompiledMacros()
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual voidCloseConnection(int sock, Bool_t force = kFALSE)
virtual voidCloselog()
virtual intClosePipe(FILE* pipe)
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual intTSystem::CompileMacro(const char* filename, Option_t* opt = "", const char* library_name = "", const char* build_dir = "", UInt_t dirmode = 0)
virtual char*TSystem::ConcatFileName(const char* dir, const char* name)
intConnectService(const char* server, int port, int tcpwindowsize)
virtual voidTNamed::Copy(TObject& named) const
virtual intCopyFile(const char* from, const char* to, Bool_t overwrite = kFALSE)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual const char*TSystem::DirName(const char* pathname)
virtual voidDispatchOneEvent(Bool_t pendingOnly = kFALSE)
voidDispatchSignals(ESignals sig)
Bool_tDispatchTimers(Bool_t mode)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual Func_tDynFindSymbol(const char* module, const char* entry)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual Int_tExec(const char* shellcmd)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidExit(int code, Bool_t mode = kTRUE)
virtual voidTSystem::ExitLoop()
virtual Bool_tExpandPathName(TString& patbuf)
virtual char*ExpandPathName(const char* path)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual const char*FindFile(const char* search, TString& file, EAccessMode mode = kFileExists)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual voidFreeDirectory(void* dirp)
virtual TSystem::EAclicModeTSystem::GetAclicMode() const
virtual Int_tTSystem::GetAclicProperties() const
voidTSystem::GetBeepDefaults(Int_t& freq, Int_t& duration) const
virtual const char*TSystem::GetBuildArch() const
virtual const char*TSystem::GetBuildCompiler() const
virtual const char*TSystem::GetBuildCompilerVersion() const
virtual const char*TSystem::GetBuildDir() const
virtual const char*TSystem::GetBuildNode() const
virtual intGetCpuInfo(CpuInfo_t* info, Int_t sampleTime = 1000) const
virtual const char*GetDirEntry(void* dirp)
virtual void*TSystem::GetDirPtr() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*GetDynamicPath()
virtual Int_tGetEffectiveGid()
virtual Int_tGetEffectiveUid()
virtual const char*Getenv(const char* name)
static Int_tTSystem::GetErrno()
virtual const char*GetError()
const char*TSystem::GetErrorStr() const
virtual const char*TSystem::GetFlagsDebug() const
virtual const char*TSystem::GetFlagsOpt() const
virtual Int_tGetFPEMask()
virtual TStringTSystem::GetFromPipe(const char* command)
virtual intGetFsInfo(const char* path, Long_t* id, Long_t* bsize, Long_t* blocks, Long_t* bfree)
virtual Int_tGetGid(const char* group = 0)
virtual UserGroup_t*GetGroupInfo(Int_t gid)
virtual UserGroup_t*GetGroupInfo(const char* group = 0)
virtual TInetAddressGetHostByName(const char* server)
virtual const char*TObject::GetIconName() const
virtual const char*TSystem::GetIncludePath()
virtual const char*TSystem::GetLibraries(const char* regexp = "", const char* option = "", Bool_t isRegexp = kTRUE)
virtual const char*TSystem::GetLinkdefSuffix() const
virtual const char*TSystem::GetLinkedLibs() const
virtual TSeqCollection*TSystem::GetListOfFileHandlers() const
virtual TSeqCollection*TSystem::GetListOfSignalHandlers() const
virtual TSeqCollection*TSystem::GetListOfStdExceptionHandlers() const
virtual TSeqCollection*TSystem::GetListOfTimers() const
virtual const char*TSystem::GetMakeExe() const
virtual const char*TSystem::GetMakeSharedLib() const
virtual intGetMemInfo(MemInfo_t* info) const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual const char*TSystem::GetObjExt() const
virtual Option_t*TObject::GetOption() const
virtual intGetPathInfo(const char* path, FileStat_t& buf)
virtual TInetAddressGetPeerName(int sock)
virtual intGetPid()
virtual intGetProcInfo(ProcInfo_t* info) const
virtual intGetServiceByName(const char* service)
virtual char*GetServiceByPort(int port)
virtual TInetAddressGetSockName(int sock)
virtual intGetSockOpt(int sock, int option, int* val)
virtual const char*TSystem::GetSoExt() const
virtual intGetSysInfo(SysInfo_t* info) const
virtual const char*TNamed::GetTitle() const
virtual Int_tGetUid(const char* user = 0)
virtual UInt_tTObject::GetUniqueID() const
virtual UserGroup_t*GetUserInfo(Int_t uid)
virtual UserGroup_t*GetUserInfo(const char* user = 0)
virtual TList*TSystem::GetVolumes(Option_t*) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual const char*HomeDirectory(const char* userName = 0)
virtual const char*HostName()
virtual voidTSystem::IgnoreInterrupt(Bool_t ignore = kTRUE)
virtual voidIgnoreSignal(ESignals sig, Bool_t ignore = kTRUE)
Bool_tTSystem::InControl() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual Bool_tInit()
virtual voidTSystem::InnerLoop()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTSystem::IsAbsoluteFileName(const char* dir)
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTSystem::IsFileInIncludePath(const char* name, char** fullpath = 0)
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsPathLocal(const char* path)
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual intLink(const char* from, const char* to)
virtual voidListLibraries(const char* regexp = "")
virtual voidListSymbols(const char* module, const char* re = "")
virtual intLoad(const char* module, const char* entry = "", Bool_t system = kFALSE)
virtual voidTNamed::ls(Option_t* option = "") const
virtual intMakeDirectory(const char* name)
voidTObject::MayNotUse(const char* method) const
virtual intTSystem::mkdir(const char* name, Bool_t recursive = kFALSE)
virtual Long_tTSystem::NextTimeOut(Bool_t mode)
virtual Bool_tTObject::Notify()
virtual voidTSystem::NotifyApplicationCreated()
virtual TTimeNow()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
virtual intOpenConnection(const char* server, int port, int tcpwindowsize = -1)
virtual void*OpenDirectory(const char* name)
virtual voidOpenlog(const char* name, Int_t options, ELogFacility facility)
virtual FILE*OpenPipe(const char* shellcmd, const char* mode)
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TNamed&TNamed::operator=(const TNamed& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual const char*PrependPathName(const char* dir, TString& name)
virtual voidTNamed::Print(Option_t* option = "") const
virtual Bool_tTSystem::ProcessEvents()
const char*TSystem::pwd()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual intRecvBuf(int sock, void* buffer, int length)
virtual intRecvRaw(int sock, void* buffer, int length, int flag)
virtual Int_tRedirectOutput(const char* name, const char* mode = "a", RedirectHandle_t* h = 0)
virtual TFileHandler*RemoveFileHandler(TFileHandler* fh)
voidTSystem::RemoveOnExit(TObject* obj)
virtual TSignalHandler*RemoveSignalHandler(TSignalHandler* sh)
virtual TStdExceptionHandler*TSystem::RemoveStdExceptionHandler(TStdExceptionHandler* eh)
virtual TTimer*RemoveTimer(TTimer* ti)
virtual intRename(const char* from, const char* to)
voidTObject::ResetBit(UInt_t f)
static voidTSystem::ResetErrno()
virtual voidResetSignal(ESignals sig, Bool_t reset = kTRUE)
virtual voidResetTimer(TTimer* ti)
virtual voidTSystem::Run()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual Int_tSelect(TList* active, Long_t timeout)
virtual Int_tSelect(TFileHandler* fh, Long_t timeout)
virtual intSendBuf(int sock, const void* buffer, int length)
virtual intSendRaw(int sock, const void* buffer, int length, int flag)
virtual voidTSystem::SetAclicMode(TSystem::EAclicMode mode)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTSystem::SetBuildDir(const char* build_dir, Bool_t isflat = kFALSE)
virtual voidSetDisplay()
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetDynamicPath(const char* lib)
virtual voidSetenv(const char* name, const char* value)
voidTSystem::SetErrorStr(const char* errstr)
virtual voidTSystem::SetFlagsDebug(const char*)
virtual voidTSystem::SetFlagsOpt(const char*)
virtual Int_tSetFPEMask(Int_t mask = kDefaultMask)
virtual voidTSystem::SetIncludePath(const char* includePath)
virtual voidTSystem::SetLinkdefSuffix(const char* suffix)
virtual voidTSystem::SetLinkedLibs(const char* linkedLibs)
virtual voidTSystem::SetMakeExe(const char* directives)
virtual voidTSystem::SetMakeSharedLib(const char* directives)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTSystem::SetObjExt(const char* objExt)
virtual voidSetProgname(const char* name)
virtual intSetSockOpt(int sock, int option, int val)
virtual voidTSystem::SetSoExt(const char* soExt)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidTSystem::ShowOutput(RedirectHandle_t* h)
virtual voidSigAlarmInterruptsSyscalls(Bool_t set)
virtual Int_tTNamed::Sizeof() const
virtual voidSleep(UInt_t milliSec)
virtual TStringTSystem::SplitAclicMode(const char* filename, TString& mode, TString& args, TString& io) const
virtual voidStackTrace()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual intSymlink(const char* from, const char* to)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
virtual voidSyslog(ELogLevel level, const char* mess)
virtual const char*TempDirectory() const
virtual FILE*TempFileName(TString& base, const char* dir = 0)
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual intUmask(Int_t mask)
virtual const char*TSystem::UnixPathName(const char* unixpathname)
virtual intUnlink(const char* name)
virtual voidUnload(const char* module)
virtual voidTSystem::Unsetenv(const char* name)
virtual voidTObject::UseCurrentStyle()
virtual intUtime(const char* file, Long_t modtime, Long_t actime)
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual char*TSystem::Which(const char* search, const char* file, EAccessMode mode = kFileExists)
virtual const char*WorkingDirectory()
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual Bool_tTSystem::ConsistentWith(const char* path, void* dirptr = 0)
virtual voidTSystem::DoBeep(Int_t = -1, Int_t = -1) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual char*DynamicPathName(const char* lib, Bool_t quiet = kFALSE)
virtual const char*TSystem::ExpandFileName(const char* fname)
static void*FindDynLib(const char* lib)
TSystem*TSystem::FindHelper(const char* path, void* dirptr = 0)
virtual const char*GetLinkedLibraries()
voidTObject::MakeZombie()
static intReadUtmpFile()
static void*SearchUtmpEntry(int nentries, const char* tty)
static const char*TSystem::StripOffProto(const char* path, const char* proto)
static Func_tUnixDynFindSymbol(const char* lib, const char* entry)
static voidUnixDynListLibs(const char* lib = "")
static voidUnixDynListSymbols(const char* lib, const char* re = "")
static intUnixDynLoad(const char* lib)
static voidUnixDynUnload(const char* lib)
static intUnixFilestat(const char* path, FileStat_t& buf)
static intUnixFSstat(const char* path, Long_t* id, Long_t* bsize, Long_t* blocks, Long_t* bfree)
static const char*UnixGetdirentry(void* dir)
static const char*UnixHomedirectory(const char* user = 0)
static voidUnixIgnoreSignal(ESignals sig, Bool_t ignore)
static intUnixMakedir(const char* name)
static Long64_tUnixNow()
static void*UnixOpendir(const char* name)
static intUnixRecv(int sock, void* buf, int len, int flag)
static voidUnixResetSignal(ESignals sig)
static voidUnixResetSignals()
static intUnixSelect(Int_t nfds, TFdSet* readready, TFdSet* writeready, Long_t timeout)
static intUnixSend(int sock, const void* buf, int len, int flag)
static intUnixSetitimer(Long_t ms)
static voidUnixSigAlarmInterruptsSyscalls(Bool_t set)
static voidUnixSignal(ESignals sig, void* h)
static const char*UnixSigname(ESignals sig)
static intUnixTcpConnect(const char* hostname, int port, int tcpwindowsize)
static intUnixTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize)
static intUnixUnixConnect(int port)
static intUnixUnixConnect(const char* path)
static intUnixUnixService(int port, int backlog)
static intUnixUnixService(const char* sockpath, int backlog)
static intUnixWaitchild()

Data Members

public:
enum TSystem::EAclicMode { kDefault
kDebug
kOpt
};
enum TSystem::EAclicProperties { kFlatBuildDir
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TSystem::EAclicModeTSystem::fAclicModeWhether the compilation should be done debug or opt
Int_tTSystem::fAclicPropertiesVarious boolean flag for change ACLiC's behavior.
Int_tTSystem::fBeepDurationUsed by Beep()
Int_tTSystem::fBeepFreqUsed by Beep()
TStringTSystem::fBuildArchArchitecure for which ROOT was built (passed to ./configure)
TStringTSystem::fBuildCompilerCompiler used to build this ROOT
TStringTSystem::fBuildCompilerVersionCompiler version used to build this ROOT
TStringTSystem::fBuildDirLocation where to build ACLiC shared library and use as scratch area.
TStringTSystem::fBuildNodeDetailed information where ROOT was built
TSeqCollection*TSystem::fCompiledList of shared libs from compiled macros to be deleted
Bool_tTSystem::fDoneTrue if eventloop should be finished
TSeqCollection*TSystem::fFileHandlerList of file handlers
TStringTSystem::fFlagsDebugFlags for debug compilation
TStringTSystem::fFlagsOptFlags for optimized compilation
TSeqCollection*TSystem::fHelpersList of helper classes for alternative file/directory access
TStringTSystem::fHostnameHostname
Bool_tTSystem::fInControlTrue if in eventloop
TStringTSystem::fIncludePathUsed to expand $IncludePath in the directives given to SetMakeSharedLib and SetMakeExe
Bool_tTSystem::fInsideNotifyUsed by DispatchTimers()
TStringTSystem::fLastErrorStringLast system error message
Int_tTSystem::fLevelLevel of nested eventloops
TStringTSystem::fLinkdefSuffixDefault suffix for linkdef files to be used by ACLiC (see EACLiCProperties)
TStringTSystem::fLinkedLibsUsed to expand $LinkedLibs in the directives given to SetMakeSharedLib and SetMakeExe
TStringTSystem::fListLibsList shared libraries, cache used by GetLibraries
TStringTSystem::fListPathsList of all include (fIncludePath + interpreter include path). Cache used by GetIncludePath
TStringTSystem::fMakeExeDirective used to build an executable
TStringTSystem::fMakeSharedLibDirective used to build a shared library
Int_tTSystem::fMaxrfdLargest fd in read mask
Int_tTSystem::fMaxwfdLargest fd in write mask
TStringTNamed::fNameobject identifier
Int_tTSystem::fNfdNumber of fd's in masks
TStringTSystem::fObjExtExtension of object files (.o, .obj, etc.)
TSeqCollection*TSystem::fOnExitListList of items to be cleaned-up on exit
TFdSet*TSystem::fReadmask!Files that should be checked for read events
TFdSet*TSystem::fReadready!Files with reads waiting
Int_tTSystem::fSigcntNumber of pending signals
TSeqCollection*TSystem::fSignalHandlerList of signal handlers
TFdSet*TSystem::fSignals!Signals that were trapped
TStringTSystem::fSoExtExtension of shared library (.so, .sl, .a, .dll, etc.)
TSeqCollection*TSystem::fStdExceptionHandlerList of std::exception handlers
TSeqCollection*TSystem::fTimersList of timers
TStringTNamed::fTitleobject title
TStringTSystem::fWdpathWorking directory
TFdSet*TSystem::fWritemask!Files that should be checked for write events
TFdSet*TSystem::fWriteready!Files with writes waiting

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TUnixSystem()
{ }
~TUnixSystem()
 Reset to original state.
Bool_t Init()
 Initialize Unix system interface.
void SetProgname(const char* name)
 Set the application name (from command line, argv[0]) and copy it in
 gProgName. Copy the application pathname in gProgPath.
 If name is 0 let the system set the actual executable name and path
 (works on MacOS X and Linux).
void SetDisplay()
 Set DISPLAY environment variable based on utmp entry. Only for UNIX.
const char * GetError()
 Return system error string.
const char * HostName()
 Return the system's host name.
void AddFileHandler(TFileHandler* fh)
 Add a file handler to the list of system file handlers. Only adds
 the handler if it is not already in the list of file handlers.
TFileHandler * RemoveFileHandler(TFileHandler* fh)
 Remove a file handler from the list of file handlers. Returns
 the handler or 0 if the handler was not in the list of file handlers.
void AddSignalHandler(TSignalHandler* sh)
 Add a signal handler to list of system signal handlers. Only adds
 the handler if it is not already in the list of signal handlers.
TSignalHandler * RemoveSignalHandler(TSignalHandler* sh)
 Remove a signal handler from list of signal handlers. Returns
 the handler or 0 if the handler was not in the list of signal handlers.
void ResetSignal(ESignals sig, Bool_t reset = kTRUE)
 If reset is true reset the signal handler for the specified signal
 to the default handler, else restore previous behaviour.
void IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE)
 If ignore is true ignore the specified signal, else restore previous
 behaviour.
void SigAlarmInterruptsSyscalls(Bool_t set)
 When the argument is true the SIGALRM signal handler is set so that
 interrupted syscalls will not be restarted by the kernel. This is
 typically used in case one wants to put a timeout on an I/O operation.
 By default interrupted syscalls will always be restarted (for all
 signals). This can be controlled for each a-synchronous TTimer via
 the method TTimer::SetInterruptSyscalls().
Int_t GetFPEMask()
 Return the bitmap of conditions that trigger a floating point exception.
Int_t SetFPEMask(Int_t mask = kDefaultMask)
 Set which conditions trigger a floating point exception.
 Return the previous set of conditions.
void DispatchOneEvent(Bool_t pendingOnly = kFALSE)
 Dispatch a single event.
void Sleep(UInt_t milliSec)
 Sleep milliSec milliseconds.
Int_t Select(TList* active, Long_t timeout)
 Select on file descriptors. The timeout to is in millisec. Returns
 the number of ready descriptors, or 0 in case of timeout, or < 0 in
 case of an error, with -2 being EINTR and -3 EBADF. In case of EINTR
 the errno has been reset and the method can be called again. Returns
 -4 in case the list did not contain any file handlers or file handlers
 with file descriptor >= 0.
Int_t Select(TFileHandler* fh, Long_t timeout)
 Select on the file descriptor related to file handler h.
 The timeout to is in millisec. Returns the number of ready descriptors,
 or 0 in case of timeout, or < 0 in case of an error, with -2 being EINTR
 and -3 EBADF. In case of EINTR the errno has been reset and the method
 can be called again. Returns -4 in case the file handler is 0 or does
 not have a file descriptor >= 0.
void DispatchSignals(ESignals sig)
 Handle and dispatch signals.
Bool_t CheckSignals(Bool_t sync)
 Check if some signals were raised and call their Notify() member.
void CheckChilds()
 Check if childs have finished.
Bool_t CheckDescriptors()
 Check if there is activity on some file descriptors and call their
 Notify() member.
int MakeDirectory(const char* name)
 Make a Unix file system directory. Returns 0 in case of success and
 -1 if the directory could not be created.
void * OpenDirectory(const char* name)
 Open a Unix file system directory. Returns 0 if directory does not exist.
void FreeDirectory(void* dirp)
 Close a Unix file system directory.
const char * GetDirEntry(void* dirp)
 Get next Unix file system directory entry. Returns 0 if no more entries.
Bool_t ChangeDirectory(const char* path)
 Change directory. Returns kTRUE in case of success, kFALSE otherwise.
const char * WorkingDirectory()
 Return working directory.
const char * HomeDirectory(const char* userName = 0)
 Return the user's home directory.
const char * TempDirectory() const
 Return a user configured or systemwide directory to create
 temporary files in.
FILE * TempFileName(TString& base, const char* dir = 0)
 Create a secure temporary file by appending a unique
 6 letter string to base. The file will be created in
 a standard (system) directory or in the directory
 provided in dir. The full filename is returned in base
 and a filepointer is returned for safely writing to the file
 (this avoids certain security problems). Returns 0 in case
 of error.
const char * PrependPathName(const char* dir, TString& name)
 Concatenate a directory and a file name.
Bool_t AccessPathName(const char* path, EAccessMode mode = kFileExists)
 Returns FALSE if one can access a file using the specified access mode.
 Mode is the same as for the Unix access(2) function.
 Attention, bizarre convention of return value!!
int CopyFile(const char* from, const char* to, Bool_t overwrite = kFALSE)
 Copy a file. If overwrite is true and file already exists the
 file will be overwritten. Returns 0 when successful, -1 in case
 of file open failure, -2 in case the file already exists and overwrite
 was false and -3 in case of error during copy.
int Rename(const char* from, const char* to)
 Rename a file. Returns 0 when successful, -1 in case of failure.
Bool_t IsPathLocal(const char* path)
 Returns TRUE if the url in 'path' points to the local file system.
 This is used to avoid going through the NIC card for local operations.
int GetPathInfo(const char* path, FileStat_t& buf)
 Get info about a file. Info is returned in the form of a FileStat_t
 structure (see TSystem.h).
 The function returns 0 in case of success and 1 if the file could
 not be stat'ed.
int GetFsInfo(const char* path, Long_t* id, Long_t* bsize, Long_t* blocks, Long_t* bfree)
 Get info about a file system: id, bsize, bfree, blocks.
 Id      is file system type (machine dependend, see statfs())
 Bsize   is block size of file system
 Blocks  is total number of blocks in file system
 Bfree   is number of free blocks in file system
 The function returns 0 in case of success and 1 if the file system could
 not be stat'ed.
int Link(const char* from, const char* to)
 Create a link from file1 to file2. Returns 0 when successful,
 -1 in case of failure.
int Symlink(const char* from, const char* to)
 Create a symlink from file1 to file2. Returns 0 when succesfull,
 -1 in case of failure.
int Unlink(const char* name)
 Unlink, i.e. remove, a file or directory. Returns 0 when succesfull,
 -1 in case of failure.
Bool_t ExpandPathName(TString& patbuf)
 Expand a pathname getting rid of special shell characters like ~.$, etc.
 For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
 environment variables in a pathname. If compatibility is not an issue
 you can use on Unix directly $XXX. Returns kFALSE in case of success
 or kTRUE in case of error.
Bool_t ExpandPathName(TString& patbuf)
 Expand a pathname getting rid of special shell characters like ~.$, etc.
 For Unix/Win32 compatibility use $(XXX) instead of $XXX when using
 environment variables in a pathname. If compatibility is not an issue
 you can use on Unix directly $XXX. Returns kFALSE in case of success
 or kTRUE in case of error.
int Chmod(const char* file, UInt_t mode)
 Set the file permission bits. Returns -1 in case or error, 0 otherwise.
int Umask(Int_t mask)
 Set the process file creation mode mask.
int Utime(const char* file, Long_t modtime, Long_t actime)
 Set a files modification and access times. If actime = 0 it will be
 set to the modtime. Returns 0 on success and -1 in case of error.
const char * FindFile(const char* search, TString& file, EAccessMode mode = kFileExists)
 Find location of file "wfil" in a search path.
 The search path is specified as a : separated list of directories.
 Return value is pointing to wfile for compatibility with
 Which(const char*,const char*,EAccessMode) version.
Int_t GetUid(const char* user = 0)
 Returns the user's id. If user = 0, returns current user's id.
Int_t GetEffectiveUid()
 Returns the effective user id. The effective id corresponds to the
 set id bit on the file being executed.
Int_t GetGid(const char* group = 0)
 Returns the group's id. If group = 0, returns current user's group.
Int_t GetEffectiveGid()
 Returns the effective group id. The effective group id corresponds
 to the set id bit on the file being executed.
UserGroup_t * GetUserInfo(Int_t uid)
 Returns all user info in the UserGroup_t structure. The returned
 structure must be deleted by the user. In case of error 0 is returned.
UserGroup_t * GetUserInfo(const char* user = 0)
 Returns all user info in the UserGroup_t structure. If user = 0, returns
 current user's id info. The returned structure must be deleted by the
 user. In case of error 0 is returned.
UserGroup_t * GetGroupInfo(Int_t gid)
 Returns all group info in the UserGroup_t structure. The only active
 fields in the UserGroup_t structure for this call are:
    fGid and fGroup
 The returned structure must be deleted by the user. In case of
 error 0 is returned.
UserGroup_t * GetGroupInfo(const char* group = 0)
 Returns all group info in the UserGroup_t structure. The only active
 fields in the UserGroup_t structure for this call are:
    fGid and fGroup
 If group = 0, returns current user's group. The returned structure
 must be deleted by the user. In case of error 0 is returned.
void Setenv(const char* name, const char* value)
 Set environment variable. The string passed will be owned by
 the environment and can not be reused till a "name" is set
 again. The solution below will lose the space for the string
 in that case, but if this functions is not called thousands
 of times that should not be a problem.
const char * Getenv(const char* name)
 Get environment variable.
int Exec(const char* shellcmd)
 Execute a command.
FILE * OpenPipe(const char* shellcmd, const char* mode)
 Open a pipe.
int ClosePipe(FILE* pipe)
 Close the pipe.
int GetPid()
 Get process id.
void Exit(int code, Bool_t mode = kTRUE)
 Exit the application.
void Abort(int code = 0)
 Abort the application.
void StackTrace()
 Print a stack trace.
void Openlog(const char* name, Int_t options, ELogFacility facility)
 Open connection to system log daemon. For the use of the options and
 facility see the Unix openlog man page.
void Syslog(ELogLevel level, const char* mess)
 Send mess to syslog daemon. Level is the logging level and mess the
 message that will be written on the log.
void Closelog()
 Close connection to system log daemon.
Int_t RedirectOutput(const char* name, const char* mode = "a", RedirectHandle_t* h = 0)
 Redirect standard output (stdout, stderr) to the specified file.
 If the file argument is 0 the output is set again to stderr, stdout.
 The second argument specifies whether the output should be added to the
 file ("a", default) or the file be truncated before ("w").
 This function saves internally the current state into a static structure.
 The call can be made reentrant by specifying the opaque structure pointed
 by 'h', which is filled with the relevant information. The handle 'h'
 obtained on the first call must then be used in any subsequent call,
 included ShowOutput, to display the redirected output.
 Returns 0 on success, -1 in case of error.
Func_t DynFindSymbol(const char* module, const char* entry)
dynamic linking of module
int Load(const char* module, const char* entry = "", Bool_t system = kFALSE)
 Load a shared library. Returns 0 on successful loading, 1 in
 case lib was already loaded and -1 in case lib does not exist
 or in case of error.
void Unload(const char* module)
 Unload a shared library.
void ListSymbols(const char* module, const char* re = "")
 List symbols in a shared library.
void ListLibraries(const char* regexp = "")
 List all loaded shared libraries.
const char * GetLinkedLibraries()
 Get list of shared libraries loaded at the start of the executable.
 Returns 0 in case list cannot be obtained or in case of error.
TTime Now()
 Get current time in milliseconds since 0:00 Jan 1 1995.
Bool_t DispatchTimers(Bool_t mode)
 Handle and dispatch timers. If mode = kTRUE dispatch synchronous
 timers else a-synchronous timers.
void AddTimer(TTimer* ti)
 Add timer to list of system timers.
TTimer * RemoveTimer(TTimer* ti)
 Remove timer from list of system timers.
void ResetTimer(TTimer* ti)
 Reset a-sync timer.
TInetAddress GetHostByName(const char* server)
 Get Internet Protocol (IP) address of host. Returns an TInetAddress
 object. To see if the hostname lookup was successfull call
 TInetAddress::IsValid().
TInetAddress GetSockName(int sock)
 Get Internet Protocol (IP) address of host and port #.
TInetAddress GetPeerName(int sock)
 Get Internet Protocol (IP) address of remote host and port #.
int GetServiceByName(const char* service)
 Get port # of internet service.
char * GetServiceByPort(int port)
 Get name of internet service.
int ConnectService(const char* server, int port, int tcpwindowsize)
 Connect to service servicename on server servername.
int OpenConnection(const char* server, int port, int tcpwindowsize = -1)
 Open a connection to a service on a server. Returns -1 in case
 connection cannot be opened.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Is called via the TSocket constructor.
int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1)
 Announce TCP/IP service.
 Open a socket, bind to it and start listening for TCP/IP connections
 on the port. If reuse is true reuse the address, backlog specifies
 how many sockets can be waiting to be accepted.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns socket fd or -1 if socket() failed, -2 if bind() failed
 or -3 if listen() failed.
int AnnounceUnixService(int port, int backlog)
 Announce unix domain service on path "kServerPath/<port>"
int AnnounceUnixService(const char* sockpath, int backlog)
 Announce unix domain service on path 'sockpath'
int AcceptConnection(int sock)
 Accept a connection. In case of an error return -1. In case
 non-blocking I/O is enabled and no connections are available
 return -2.
void CloseConnection(int sock, Bool_t force = kFALSE)
 Close socket.
int RecvBuf(int sock, void* buffer, int length)
 Receive a buffer headed by a length indicator. Lenght is the size of
 the buffer. Returns the number of bytes received in buf or -1 in
 case of error.
int SendBuf(int sock, const void* buffer, int length)
 Send a buffer headed by a length indicator. Returns length of sent buffer
 or -1 in case of error.
int RecvRaw(int sock, void* buffer, int length, int flag)
 Receive exactly length bytes into buffer. Use opt to receive out-of-band
 data or to have a peek at what is in the buffer (see TSocket). Buffer
 must be able to store at least length bytes. Returns the number of
 bytes received (can be 0 if other side of connection was closed) or -1
 in case of error, -2 in case of MSG_OOB and errno == EWOULDBLOCK, -3
 in case of MSG_OOB and errno == EINVAL and -4 in case of kNoBlock and
 errno == EWOULDBLOCK. Returns -5 if pipe broken or reset by peer
 (EPIPE || ECONNRESET).
int SendRaw(int sock, const void* buffer, int length, int flag)
 Send exactly length bytes from buffer. Use opt to send out-of-band
 data (see TSocket). Returns the number of bytes sent or -1 in case of
 error. Returns -4 in case of kNoBlock and errno == EWOULDBLOCK.
 Returns -5 if pipe broken or reset by peer (EPIPE || ECONNRESET).
int SetSockOpt(int sock, int option, int val)
 Set socket option.
int GetSockOpt(int sock, int option, int* val)
 Get socket option.
void UnixSignal(ESignals sig, void* h)
 Set a signal handler for a signal.
void UnixIgnoreSignal(ESignals sig, Bool_t ignore)
 If ignore is true ignore the specified signal, else restore previous
 behaviour.
void UnixSigAlarmInterruptsSyscalls(Bool_t set)
 When the argument is true the SIGALRM signal handler is set so that
 interrupted syscalls will not be restarted by the kernel. This is
 typically used in case one wants to put a timeout on an I/O operation.
 By default interrupted syscalls will always be restarted (for all
 signals). This can be controlled for each a-synchronous TTimer via
 the method TTimer::SetInterruptSyscalls().
const char * UnixSigname(ESignals sig)
 Return the signal name associated with a signal.
void UnixResetSignal(ESignals sig)
 Restore old signal handler for specified signal.
void UnixResetSignals()
 Restore old signal handlers.
Long64_t UnixNow()
 Get current time in milliseconds since 0:00 Jan 1 1995.
int UnixSetitimer(Long_t ms)
 Set interval timer to time-out in ms milliseconds.
int UnixSelect(Int_t nfds, TFdSet* readready, TFdSet* writeready, Long_t timeout)
 Wait for events on the file descriptors specified in the readready and
 writeready masks or for timeout (in milliseconds) to occur. Returns
 the number of ready descriptors, or 0 in case of timeout, or < 0 in
 case of an error, with -2 being EINTR and -3 EBADF. In case of EINTR
 the errno has been reset and the method can be called again.
const char * UnixHomedirectory(const char* user = 0)
 Returns the user's home directory.
int UnixMakedir(const char* name)
 Make a Unix file system directory. Returns 0 in case of success and
 -1 if the directory could not be created (either already exists or
 illegal path name).
void * UnixOpendir(const char* name)
 Open a directory.
const char * UnixGetdirentry(void* dir)
 Returns the next directory entry.
int UnixFilestat(const char* path, FileStat_t& buf)
 Get info about a file. Info is returned in the form of a FileStat_t
 structure (see TSystem.h).
 The function returns 0 in case of success and 1 if the file could
 not be stat'ed.
int UnixFSstat(const char* path, Long_t* id, Long_t* bsize, Long_t* blocks, Long_t* bfree)
 Get info about a file system: id, bsize, bfree, blocks.
 Id      is file system type (machine dependend, see statfs())
 Bsize   is block size of file system
 Blocks  is total number of blocks in file system
 Bfree   is number of free blocks in file system
 The function returns 0 in case of success and 1 if the file system could
 not be stat'ed.
int UnixWaitchild()
 Wait till child is finished.
int UnixTcpConnect(const char* hostname, int port, int tcpwindowsize)
 Open a TCP/IP connection to server and connect to a service (i.e. port).
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Is called via the TSocket constructor. Returns -1 in case of error.
int UnixUnixConnect(int port)
 Connect to a Unix domain socket.
int UnixUnixConnect(const char* path)
 Connect to a Unix domain socket. Returns -1 in case of error.
int UnixTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize)
 Open a socket, bind to it and start listening for TCP/IP connections
 on the port. If reuse is true reuse the address, backlog specifies
 how many sockets can be waiting to be accepted. If port is 0 a port
 scan will be done to find a free port. This option is mutual exlusive
 with the reuse option.
 Use tcpwindowsize to specify the size of the receive buffer, it has
 to be specified here to make sure the window scale option is set (for
 tcpwindowsize > 65KB and for platforms supporting window scaling).
 Returns socket fd or -1 if socket() failed, -2 if bind() failed
 or -3 if listen() failed.
int UnixUnixService(int port, int backlog)
 Open a socket, bind to it and start listening for Unix domain connections
 to it. Returns socket fd or -1.
int UnixUnixService(const char* sockpath, int backlog)
 Open a socket on path 'sockpath', bind to it and start listening for Unix
 domain connections to it. Returns socket fd or -1.
int UnixRecv(int sock, void* buf, int len, int flag)
 Receive exactly length bytes into buffer. Returns number of bytes
 received. Returns -1 in case of error, -2 in case of MSG_OOB
 and errno == EWOULDBLOCK, -3 in case of MSG_OOB and errno == EINVAL
 and -4 in case of kNoBlock and errno == EWOULDBLOCK.
 Returns -5 if pipe broken or reset by peer (EPIPE || ECONNRESET).
int UnixSend(int sock, const void* buf, int len, int flag)
 Send exactly length bytes from buffer. Returns -1 in case of error,
 otherwise number of sent bytes. Returns -4 in case of kNoBlock and
 errno == EWOULDBLOCK. Returns -5 if pipe broken or reset by peer
 (EPIPE || ECONNRESET).
void AddDynamicPath(const char* lib)
 Add a new directory to the dynamic path.
const char * GetDynamicPath()
 Return the dynamic path (used to find shared libraries).
void SetDynamicPath(const char* lib)
 Set the dynamic path to a new value.
 If the value of 'path' is zero, the dynamic path is reset to its
 default value.
char * DynamicPathName(const char* lib, Bool_t quiet = kFALSE)
 Returns the path of a shared library (searches for library in the
 shared library search path). If no file name extension is provided
 it first tries .so, .sl, .dl and then .a (for AIX). The returned string
 must be deleted.
void * FindDynLib(const char* lib)
 Returns the handle to a loaded shared library. Returns 0 when library
 not loaded.
int UnixDynLoad(const char* lib)
 Load a shared library. Returns 0 on successful loading, 1 in
 case lib was already loaded and -1 in case lib does not exist
 or in case of error.
Func_t UnixDynFindSymbol(const char* lib, const char* entry)
 Finds and returns a function pointer to a symbol in the shared library.
 Returns 0 when symbol not found.
void UnixDynListSymbols(const char* lib, const char* re = "")
 List symbols in a shared library. One can use wildcards to list only
 the interesting symbols.
void UnixDynListLibs(const char* lib = "")
 List all loaded shared libraries.
void UnixDynUnload(const char* lib)
 Unload a shared library.
int ReadUtmpFile()
 Read utmp file. Returns number of entries in utmp file.
void * SearchUtmpEntry(int nentries, const char* tty)
 Look for utmp entry which is connected to terminal tty.
int GetSysInfo(SysInfo_t* info) const
 Returns static system info, like OS type, CPU type, number of CPUs
 RAM size, etc into the SysInfo_t structure. Returns -1 in case of error,
 0 otherwise.
int GetCpuInfo(CpuInfo_t* info, Int_t sampleTime = 1000) const
 Returns cpu load average and load info into the CpuInfo_t structure.
 Returns -1 in case of error, 0 otherwise. Use sampleTime to set the
 interval over which the CPU load will be measured, in ms (default 1000).
int GetMemInfo(MemInfo_t* info) const
 Returns ram and swap memory usage info into the MemInfo_t structure.
 Returns -1 in case of error, 0 otherwise.
int GetProcInfo(ProcInfo_t* info) const
 Returns cpu and memory used by this process into the ProcInfo_t structure.
 Returns -1 in case of error, 0 otherwise.