TSystem.h

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TSystem.h 37109 2010-11-30 16:30:58Z pcanal $
00002 // Author: Fons Rademakers   15/09/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TSystem
00013 #define ROOT_TSystem
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TSystem                                                              //
00019 //                                                                      //
00020 // Abstract base class defining a generic interface to the underlying   //
00021 // Operating System.                                                    //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef __CINT__
00026 #include <stdio.h>
00027 #include <ctype.h>
00028 #include <fcntl.h>
00029 #ifndef WIN32
00030 #include <unistd.h>
00031 #endif
00032 #endif
00033 
00034 #ifndef ROOT_TNamed
00035 #include "TNamed.h"
00036 #endif
00037 #ifndef ROOT_TString
00038 #include "TString.h"
00039 #endif
00040 #ifndef ROOT_TInetAddress
00041 #include "TInetAddress.h"
00042 #endif
00043 #ifndef ROOT_TTimer
00044 #include "TTimer.h"
00045 #endif
00046 
00047 class TSeqCollection;
00048 class TFdSet;
00049 class TVirtualMutex;
00050 
00051 enum EAccessMode {
00052    kFileExists        = 0,
00053    kExecutePermission = 1,
00054    kWritePermission   = 2,
00055    kReadPermission    = 4
00056 };
00057 
00058 enum ELogOption {
00059    kLogPid            = 0x01,
00060    kLogCons           = 0x02
00061 };
00062 
00063 enum ELogLevel {
00064    kLogEmerg          = 0,
00065    kLogAlert          = 1,
00066    kLogCrit           = 2,
00067    kLogErr            = 3,
00068    kLogWarning        = 4,
00069    kLogNotice         = 5,
00070    kLogInfo           = 6,
00071    kLogDebug          = 7
00072 };
00073 
00074 enum ELogFacility {
00075    kLogLocal0,
00076    kLogLocal1,
00077    kLogLocal2,
00078    kLogLocal3,
00079    kLogLocal4,
00080    kLogLocal5,
00081    kLogLocal6,
00082    kLogLocal7
00083 };
00084 
00085 enum ESysConstants {
00086    kMAXSIGNALS       = 15,
00087    kMAXPATHLEN       = 8192,
00088    kBUFFERSIZE       = 8192,
00089    kItimerResolution = 10      // interval-timer resolution in ms
00090 };
00091 
00092 enum EFpeMask {
00093    kNoneMask         = 0x00,
00094    kInvalid          = 0x01,  // Invalid argument
00095    kDivByZero        = 0x02,  // Division by zero
00096    kOverflow         = 0x04,  // Overflow
00097    kUnderflow        = 0x08,  // Underflow
00098    kInexact          = 0x10,  // Inexact
00099    kDefaultMask      = 0x07,
00100    kAllMask          = 0x1F
00101 };
00102 
00103 enum EFileModeMask {
00104    kS_IFMT   = 0170000,   // bitmask for the file type bitfields
00105    kS_IFSOCK = 0140000,   // socket
00106    kS_IFLNK  = 0120000,   // symbolic link
00107    kS_IFOFF  = 0110000,   // offline file
00108    kS_IFREG  = 0100000,   // regular file
00109    kS_IFBLK  = 0060000,   // block device
00110    kS_IFDIR  = 0040000,   // directory
00111    kS_IFCHR  = 0020000,   // character device
00112    kS_IFIFO  = 0010000,   // fifo
00113    kS_ISUID  = 0004000,   // set UID bit
00114    kS_ISGID  = 0002000,   // set GID bit
00115    kS_ISVTX  = 0001000,   // sticky bit
00116    kS_IRWXU  = 00700,     // mask for file owner permissions
00117    kS_IRUSR  = 00400,     // owner has read permission
00118    kS_IWUSR  = 00200,     // owner has write permission
00119    kS_IXUSR  = 00100,     // owner has execute permission
00120    kS_IRWXG  = 00070,     // mask for group permissions
00121    kS_IRGRP  = 00040,     // group has read permission
00122    kS_IWGRP  = 00020,     // group has write permission
00123    kS_IXGRP  = 00010,     // group has execute permission
00124    kS_IRWXO  = 00007,     // mask for permissions for others (not in group)
00125    kS_IROTH  = 00004,     // others have read permission
00126    kS_IWOTH  = 00002,     // others have write permisson
00127    kS_IXOTH  = 00001      // others have execute permission
00128 };
00129 
00130 inline Bool_t R_ISDIR(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFDIR); }
00131 inline Bool_t R_ISCHR(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFCHR); }
00132 inline Bool_t R_ISBLK(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFBLK); }
00133 inline Bool_t R_ISREG(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFREG); }
00134 inline Bool_t R_ISLNK(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFLNK); }
00135 inline Bool_t R_ISFIFO(Int_t mode) { return ((mode & kS_IFMT) == kS_IFIFO); }
00136 inline Bool_t R_ISSOCK(Int_t mode) { return ((mode & kS_IFMT) == kS_IFSOCK); }
00137 inline Bool_t R_ISOFF(Int_t mode)  { return ((mode & kS_IFMT) == kS_IFOFF); }
00138 
00139 struct FileStat_t {
00140    Long_t   fDev;          // device id
00141    Long_t   fIno;          // inode
00142    Int_t    fMode;         // protection (combination of EFileModeMask bits)
00143    Int_t    fUid;          // user id of owner
00144    Int_t    fGid;          // group id of owner
00145    Long64_t fSize;         // total size in bytes
00146    Long_t   fMtime;        // modification date
00147    Bool_t   fIsLink;       // symbolic link
00148    TString  fUrl;          // end point url of file
00149    FileStat_t() : fDev(0), fIno(0), fMode(0), fUid(0), fGid(0), fSize(0),
00150                   fMtime(0), fIsLink(kFALSE), fUrl("") { }
00151 };
00152 
00153 struct UserGroup_t {
00154    Int_t    fUid;          // user id
00155    Int_t    fGid;          // group id
00156    TString  fUser;         // user name
00157    TString  fGroup;        // group name
00158    TString  fPasswd;       // password
00159    TString  fRealName;     // user full name
00160    TString  fShell;        // user preferred shell
00161    UserGroup_t() : fUid(0), fGid(0), fUser(), fGroup(), fPasswd(),
00162                    fRealName (), fShell() { }
00163 };
00164 
00165 struct SysInfo_t {
00166    TString   fOS;          // OS
00167    TString   fModel;       // computer model
00168    TString   fCpuType;     // type of cpu
00169    Int_t     fCpus;        // number of cpus
00170    Int_t     fCpuSpeed;    // cpu speed in MHz
00171    Int_t     fBusSpeed;    // bus speed in MHz
00172    Int_t     fL2Cache;     // level 2 cache size in KB
00173    Int_t     fPhysRam;     // physical RAM in MB
00174    SysInfo_t() : fOS(), fModel(), fCpuType(), fCpus(0), fCpuSpeed(0),
00175                  fBusSpeed(0), fL2Cache(0), fPhysRam(0) { }
00176    virtual ~SysInfo_t() { }
00177    ClassDef(SysInfo_t, 1); // System information - OS, CPU, RAM.
00178 };
00179 
00180 struct CpuInfo_t {
00181    Float_t   fLoad1m;      // cpu load average over 1 m
00182    Float_t   fLoad5m;      // cpu load average over 5 m
00183    Float_t   fLoad15m;     // cpu load average over 15 m
00184    Float_t   fUser;        // cpu user load in percentage
00185    Float_t   fSys;         // cpu sys load in percentage
00186    Float_t   fTotal;       // cpu user+sys load in percentage
00187    Float_t   fIdle;        // cpu idle percentage
00188    CpuInfo_t() : fLoad1m(0), fLoad5m(0), fLoad15m(0),
00189                  fUser(0), fSys(0), fTotal(0), fIdle(0) { }
00190    virtual ~CpuInfo_t() { }
00191    ClassDef(CpuInfo_t, 1); // CPU load information.
00192 };
00193 
00194 struct MemInfo_t {
00195    Int_t     fMemTotal;    // total RAM in MB
00196    Int_t     fMemUsed;     // used RAM in MB
00197    Int_t     fMemFree;     // free RAM in MB
00198    Int_t     fSwapTotal;   // total swap in MB
00199    Int_t     fSwapUsed;    // used swap in MB
00200    Int_t     fSwapFree;    // free swap in MB
00201    MemInfo_t() : fMemTotal(0), fMemUsed(0), fMemFree(0),
00202                  fSwapTotal(0), fSwapUsed(0), fSwapFree(0) { }
00203    virtual ~MemInfo_t() { }
00204    ClassDef(MemInfo_t, 1); // Memory utilization information.
00205 };
00206 
00207 struct ProcInfo_t {
00208    Float_t   fCpuUser;     // user time used by this process in seconds
00209    Float_t   fCpuSys;      // system time used by this process in seconds
00210    Long_t    fMemResident; // resident memory used by this process in KB
00211    Long_t    fMemVirtual;  // virtual memory used by this process in KB
00212    ProcInfo_t() : fCpuUser(0), fCpuSys(0), fMemResident(0),
00213                   fMemVirtual(0) { }
00214    virtual ~ProcInfo_t() { }
00215    ClassDef(ProcInfo_t, 1);// System resource usage of given process.
00216 };
00217 
00218 struct RedirectHandle_t {
00219    TString   fFile;        // File where the output was redirected
00220    TString   fStdOutTty;   // tty associated with stdout, if any (e.g. from ttyname(...))
00221    TString   fStdErrTty;   // tty associated with stderr, if any (e.g. from ttyname(...))
00222    Int_t     fStdOutDup;   // Duplicated descriptor for stdout
00223    Int_t     fStdErrDup;   // Duplicated descriptor for stderr
00224    Int_t     fReadOffSet;  // Offset where to start reading the file (used by ShowOutput(...))
00225    RedirectHandle_t(const char *n = 0) : fFile(n), fStdOutTty(), fStdErrTty(), fStdOutDup(-1),
00226                                          fStdErrDup(-1), fReadOffSet(-1) { }
00227    void Reset() { fFile = ""; fStdOutTty = ""; fStdErrTty = "";
00228                   fStdOutDup = -1; fStdErrDup = -1; fReadOffSet = -1; }
00229 };
00230 
00231 #ifdef __CINT__
00232 typedef void *Func_t;
00233 #else
00234 typedef void ((*Func_t)());
00235 #endif
00236 
00237 R__EXTERN const char  *gRootDir;
00238 R__EXTERN const char  *gProgName;
00239 R__EXTERN const char  *gProgPath;
00240 R__EXTERN TVirtualMutex *gSystemMutex;
00241 
00242 
00243 //////////////////////////////////////////////////////////////////////////
00244 //                                                                      //
00245 // Asynchronous timer used for processing pending GUI and timer events  //
00246 // every delay ms. Call in a tight computing loop                       //
00247 // TProcessEventTimer::ProcessEvent(). If the timer did timeout this    //
00248 // call will process the pending events and return kTRUE if the         //
00249 // TROOT::IsInterrupted() flag is set (can be done by hitting key in    //
00250 // canvas or selecting canvas menu item View/Interrupt.                 //
00251 //                                                                      //
00252 //////////////////////////////////////////////////////////////////////////
00253 class TProcessEventTimer : public TTimer {
00254 public:
00255    TProcessEventTimer(Long_t delay);
00256    Bool_t Notify() { return kTRUE; }
00257    Bool_t ProcessEvents();
00258    ClassDef(TProcessEventTimer,0)  // Process pending events at fixed time intervals
00259 };
00260 
00261 
00262 class TSystem : public TNamed {
00263 
00264 public:
00265    enum EAclicMode { kDefault, kDebug, kOpt };
00266    enum EAclicProperties {
00267       kFlatBuildDir = BIT(0)           // If set and a BuildDir is selected, then do not created subdirectories
00268    };
00269 
00270 protected:
00271    TFdSet          *fReadmask;         //!Files that should be checked for read events
00272    TFdSet          *fWritemask;        //!Files that should be checked for write events
00273    TFdSet          *fReadready;        //!Files with reads waiting
00274    TFdSet          *fWriteready;       //!Files with writes waiting
00275    TFdSet          *fSignals;          //!Signals that were trapped
00276    Int_t            fNfd;              //Number of fd's in masks
00277    Int_t            fMaxrfd;           //Largest fd in read mask
00278    Int_t            fMaxwfd;           //Largest fd in write mask
00279    Int_t            fSigcnt;           //Number of pending signals
00280    TString          fWdpath;           //Working directory
00281    TString          fHostname;         //Hostname
00282    Bool_t           fInsideNotify;     //Used by DispatchTimers()
00283    Int_t            fBeepFreq;         //Used by Beep()
00284    Int_t            fBeepDuration;     //Used by Beep()
00285 
00286    Bool_t           fInControl;        //True if in eventloop
00287    Bool_t           fDone;             //True if eventloop should be finished
00288    Int_t            fLevel;            //Level of nested eventloops
00289    TString          fLastErrorString;  //Last system error message
00290 
00291    TSeqCollection  *fTimers;           //List of timers
00292    TSeqCollection  *fSignalHandler;    //List of signal handlers
00293    TSeqCollection  *fFileHandler;      //List of file handlers
00294    TSeqCollection  *fStdExceptionHandler; //List of std::exception handlers
00295    TSeqCollection  *fOnExitList;       //List of items to be cleaned-up on exit
00296 
00297    TString          fListLibs;         //List shared libraries, cache used by GetLibraries
00298 
00299    TString          fBuildArch;        //Architecure for which ROOT was built (passed to ./configure)
00300    TString          fBuildCompiler;    // Compiler used to build this ROOT
00301    TString          fBuildCompilerVersion; //Compiler version used to build this ROOT
00302    TString          fBuildNode;        //Detailed information where ROOT was built
00303    TString          fBuildDir;         //Location where to build ACLiC shared library and use as scratch area.
00304    TString          fFlagsDebug;       //Flags for debug compilation
00305    TString          fFlagsOpt;         //Flags for optimized compilation
00306    TString          fListPaths;        //List of all include (fIncludePath + interpreter include path). Cache used by GetIncludePath
00307    TString          fIncludePath;      //Used to expand $IncludePath in the directives given to SetMakeSharedLib and SetMakeExe
00308    TString          fLinkedLibs;       //Used to expand $LinkedLibs in the directives given to SetMakeSharedLib and SetMakeExe
00309    TString          fSoExt;            //Extension of shared library (.so, .sl, .a, .dll, etc.)
00310    TString          fObjExt;           //Extension of object files (.o, .obj, etc.)
00311    EAclicMode       fAclicMode;        //Whether the compilation should be done debug or opt
00312    TString          fMakeSharedLib;    //Directive used to build a shared library
00313    TString          fMakeExe;          //Directive used to build an executable
00314    TString          fLinkdefSuffix;    //Default suffix for linkdef files to be used by ACLiC (see EACLiCProperties)
00315    Int_t            fAclicProperties;  //Various boolean flag for change ACLiC's behavior.
00316    TSeqCollection  *fCompiled;         //List of shared libs from compiled macros to be deleted
00317    TSeqCollection  *fHelpers;          //List of helper classes for alternative file/directory access
00318 
00319    TSystem               *FindHelper(const char *path, void *dirptr = 0);
00320    virtual Bool_t         ConsistentWith(const char *path, void *dirptr = 0);
00321    virtual const char    *ExpandFileName(const char *fname);
00322    virtual void           SigAlarmInterruptsSyscalls(Bool_t) { }
00323    virtual const char    *GetLinkedLibraries();
00324    virtual void           DoBeep(Int_t /*freq*/=-1, Int_t /*duration*/=-1) const { printf("\a"); fflush(stdout); }
00325 
00326    static const char *StripOffProto(const char *path, const char *proto) {
00327       return !strncmp(path, proto, strlen(proto)) ? path + strlen(proto) : path;
00328    }
00329 
00330 private:
00331    TSystem(const TSystem&);              // not implemented
00332    TSystem& operator=(const TSystem&);   // not implemented
00333 
00334 public:
00335    TSystem(const char *name = "Generic", const char *title = "Generic System");
00336    virtual ~TSystem();
00337 
00338    //---- Misc
00339    virtual Bool_t          Init();
00340    virtual void            SetProgname(const char *name);
00341    virtual void            SetDisplay();
00342    void                    SetErrorStr(const char *errstr);
00343    const char             *GetErrorStr() const { return fLastErrorString; }
00344    virtual const char     *GetError();
00345    void                    RemoveOnExit(TObject *obj);
00346    virtual const char     *HostName();
00347    virtual void            NotifyApplicationCreated();
00348 
00349    static Int_t            GetErrno();
00350    static void             ResetErrno();
00351    void                    Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE);
00352    void                    GetBeepDefaults(Int_t &freq, Int_t &duration) const { freq = fBeepFreq; duration = fBeepDuration; }
00353 
00354    //---- EventLoop
00355    virtual void            Run();
00356    virtual Bool_t          ProcessEvents();
00357    virtual void            DispatchOneEvent(Bool_t pendingOnly = kFALSE);
00358    virtual void            ExitLoop();
00359    Bool_t                  InControl() const { return fInControl; }
00360    virtual void            InnerLoop();
00361    virtual Int_t           Select(TList *active, Long_t timeout);
00362    virtual Int_t           Select(TFileHandler *fh, Long_t timeout);
00363 
00364    //---- Handling of system events
00365    virtual void            AddSignalHandler(TSignalHandler *sh);
00366    virtual TSignalHandler *RemoveSignalHandler(TSignalHandler *sh);
00367    virtual void            ResetSignal(ESignals sig, Bool_t reset = kTRUE);
00368    virtual void            IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE);
00369    virtual void            IgnoreInterrupt(Bool_t ignore = kTRUE);
00370    virtual TSeqCollection *GetListOfSignalHandlers() const { return fSignalHandler; }
00371    virtual void            AddFileHandler(TFileHandler *fh);
00372    virtual TFileHandler   *RemoveFileHandler(TFileHandler *fh);
00373    virtual TSeqCollection *GetListOfFileHandlers() const { return fFileHandler; }
00374    virtual void            AddStdExceptionHandler(TStdExceptionHandler *eh);
00375    virtual TStdExceptionHandler *RemoveStdExceptionHandler(TStdExceptionHandler *eh);
00376    virtual TSeqCollection *GetListOfStdExceptionHandlers() const { return fStdExceptionHandler; }
00377 
00378    //---- Floating Point Exceptions Control
00379    virtual Int_t           GetFPEMask();
00380    virtual Int_t           SetFPEMask(Int_t mask = kDefaultMask);
00381 
00382    //---- Time & Date
00383    virtual TTime           Now();
00384    virtual TSeqCollection *GetListOfTimers() const { return fTimers; }
00385    virtual void            AddTimer(TTimer *t);
00386    virtual TTimer         *RemoveTimer(TTimer *t);
00387    virtual void            ResetTimer(TTimer *) { }
00388    virtual Long_t          NextTimeOut(Bool_t mode);
00389    virtual void            Sleep(UInt_t milliSec);
00390 
00391    //---- Processes
00392    virtual Int_t           Exec(const char *shellcmd);
00393    virtual FILE           *OpenPipe(const char *command, const char *mode);
00394    virtual int             ClosePipe(FILE *pipe);
00395    virtual TString         GetFromPipe(const char *command);
00396    virtual void            Exit(int code, Bool_t mode = kTRUE);
00397    virtual void            Abort(int code = 0);
00398    virtual int             GetPid();
00399    virtual void            StackTrace();
00400 
00401    //---- Directories
00402    virtual int             MakeDirectory(const char *name);
00403    virtual void           *OpenDirectory(const char *name);
00404    virtual void            FreeDirectory(void *dirp);
00405    virtual const char     *GetDirEntry(void *dirp);
00406    virtual void           *GetDirPtr() const { return 0; }
00407    virtual Bool_t          ChangeDirectory(const char *path);
00408    virtual const char     *WorkingDirectory();
00409    virtual const char     *HomeDirectory(const char *userName = 0);
00410    virtual int             mkdir(const char *name, Bool_t recursive = kFALSE);
00411    Bool_t                  cd(const char *path) { return ChangeDirectory(path); }
00412    const char             *pwd() { return WorkingDirectory(); }
00413    virtual const char     *TempDirectory() const;
00414    virtual FILE           *TempFileName(TString &base, const char *dir = 0);
00415 
00416    //---- Paths & Files
00417    virtual const char     *BaseName(const char *pathname);
00418    virtual const char     *DirName(const char *pathname);
00419    virtual char           *ConcatFileName(const char *dir, const char *name);
00420    virtual Bool_t          IsAbsoluteFileName(const char *dir);
00421    virtual Bool_t          IsFileInIncludePath(const char *name, char **fullpath = 0);
00422    virtual const char     *PrependPathName(const char *dir, TString& name);
00423    virtual Bool_t          ExpandPathName(TString &path);
00424    virtual char           *ExpandPathName(const char *path);
00425    virtual Bool_t          AccessPathName(const char *path, EAccessMode mode = kFileExists);
00426    virtual Bool_t          IsPathLocal(const char *path);
00427    virtual int             CopyFile(const char *from, const char *to, Bool_t overwrite = kFALSE);
00428    virtual int             Rename(const char *from, const char *to);
00429    virtual int             Link(const char *from, const char *to);
00430    virtual int             Symlink(const char *from, const char *to);
00431    virtual int             Unlink(const char *name);
00432    int                     GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
00433    int                     GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
00434    virtual int             GetPathInfo(const char *path, FileStat_t &buf);
00435    virtual int             GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree);
00436    virtual int             Chmod(const char *file, UInt_t mode);
00437    virtual int             Umask(Int_t mask);
00438    virtual int             Utime(const char *file, Long_t modtime, Long_t actime);
00439    virtual const char     *UnixPathName(const char *unixpathname);
00440    virtual const char     *FindFile(const char *search, TString& file, EAccessMode mode = kFileExists);
00441    virtual char           *Which(const char *search, const char *file, EAccessMode mode = kFileExists);
00442    virtual TList          *GetVolumes(Option_t *) const { return 0; }
00443 
00444    //---- Users & Groups
00445    virtual Int_t           GetUid(const char *user = 0);
00446    virtual Int_t           GetGid(const char *group = 0);
00447    virtual Int_t           GetEffectiveUid();
00448    virtual Int_t           GetEffectiveGid();
00449    virtual UserGroup_t    *GetUserInfo(Int_t uid);
00450    virtual UserGroup_t    *GetUserInfo(const char *user = 0);
00451    virtual UserGroup_t    *GetGroupInfo(Int_t gid);
00452    virtual UserGroup_t    *GetGroupInfo(const char *group = 0);
00453 
00454    //---- Environment Manipulation
00455    virtual void            Setenv(const char *name, const char *value);
00456    virtual void            Unsetenv(const char *name);
00457    virtual const char     *Getenv(const char *env);
00458 
00459    //---- System Logging
00460    virtual void            Openlog(const char *name, Int_t options, ELogFacility facility);
00461    virtual void            Syslog(ELogLevel level, const char *mess);
00462    virtual void            Closelog();
00463 
00464    //---- Standard Output redirection
00465    virtual Int_t           RedirectOutput(const char *name, const char *mode = "a", RedirectHandle_t *h = 0);
00466    virtual void            ShowOutput(RedirectHandle_t *h);
00467 
00468    //---- Dynamic Loading
00469    virtual void            AddDynamicPath(const char *pathname);
00470    virtual const char     *GetDynamicPath();
00471    virtual void            SetDynamicPath(const char *pathname);
00472    virtual char           *DynamicPathName(const char *lib, Bool_t quiet = kFALSE);
00473    virtual Func_t          DynFindSymbol(const char *module, const char *entry);
00474    virtual int             Load(const char *module, const char *entry = "", Bool_t system = kFALSE);
00475    virtual void            Unload(const char *module);
00476    virtual void            ListSymbols(const char *module, const char *re = "");
00477    virtual void            ListLibraries(const char *regexp = "");
00478    virtual const char     *GetLibraries(const char *regexp = "",
00479                                         const char *option = "",
00480                                         Bool_t isRegexp = kTRUE);
00481 
00482    //---- RPC
00483    virtual TInetAddress    GetHostByName(const char *server);
00484    virtual TInetAddress    GetPeerName(int sock);
00485    virtual TInetAddress    GetSockName(int sock);
00486    virtual int             GetServiceByName(const char *service);
00487    virtual char           *GetServiceByPort(int port);
00488    virtual int             OpenConnection(const char *server, int port, int tcpwindowsize = -1);
00489    virtual int             AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1);
00490    virtual int             AnnounceUnixService(int port, int backlog);
00491    virtual int             AnnounceUnixService(const char *sockpath, int backlog);
00492    virtual int             AcceptConnection(int sock);
00493    virtual void            CloseConnection(int sock, Bool_t force = kFALSE);
00494    virtual int             RecvRaw(int sock, void *buffer, int length, int flag);
00495    virtual int             SendRaw(int sock, const void *buffer, int length, int flag);
00496    virtual int             RecvBuf(int sock, void *buffer, int length);
00497    virtual int             SendBuf(int sock, const void *buffer, int length);
00498    virtual int             SetSockOpt(int sock, int kind, int val);
00499    virtual int             GetSockOpt(int sock, int kind, int *val);
00500 
00501    //---- System, CPU and Memory info
00502    virtual int             GetSysInfo(SysInfo_t *info) const;
00503    virtual int             GetCpuInfo(CpuInfo_t *info, Int_t sampleTime = 1000) const;
00504    virtual int             GetMemInfo(MemInfo_t *info) const;
00505    virtual int             GetProcInfo(ProcInfo_t *info) const;
00506 
00507    //---- ACLiC (Automatic Compiler of Shared Library for CINT)
00508    virtual void            AddIncludePath(const char *includePath);
00509    virtual void            AddLinkedLibs(const char *linkedLib);
00510    virtual int             CompileMacro(const char *filename, Option_t *opt="", const char* library_name = "", const char* build_dir = "", UInt_t dirmode = 0);
00511    virtual Int_t           GetAclicProperties() const;
00512    virtual const char     *GetBuildArch() const;
00513    virtual const char     *GetBuildCompiler() const;
00514    virtual const char     *GetBuildCompilerVersion() const;
00515    virtual const char     *GetBuildNode() const;
00516    virtual const char     *GetBuildDir() const;
00517    virtual const char     *GetFlagsDebug() const;
00518    virtual const char     *GetFlagsOpt() const;
00519    virtual const char     *GetIncludePath();
00520    virtual const char     *GetLinkedLibs() const;
00521    virtual const char     *GetLinkdefSuffix() const;
00522    virtual EAclicMode      GetAclicMode() const;
00523    virtual const char     *GetMakeExe() const;
00524    virtual const char     *GetMakeSharedLib() const;
00525    virtual const char     *GetSoExt() const;
00526    virtual const char     *GetObjExt() const;
00527    virtual void            SetBuildDir(const char* build_dir, Bool_t isflat = kFALSE);
00528    virtual void            SetFlagsDebug(const char *);
00529    virtual void            SetFlagsOpt(const char *);
00530    virtual void            SetIncludePath(const char *includePath);
00531    virtual void            SetMakeExe(const char *directives);
00532    virtual void            SetAclicMode(EAclicMode mode);
00533    virtual void            SetMakeSharedLib(const char *directives);
00534    virtual void            SetLinkedLibs(const char *linkedLibs);
00535    virtual void            SetLinkdefSuffix(const char *suffix);
00536    virtual void            SetSoExt(const char *soExt);
00537    virtual void            SetObjExt(const char *objExt);
00538    virtual TString         SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const;
00539    virtual void            CleanCompiledMacros();
00540 
00541    ClassDef(TSystem,0)  //ABC defining a generic interface to the OS
00542 };
00543 
00544 R__EXTERN TSystem *gSystem;
00545 R__EXTERN TFileHandler *gXDisplay;  // Display server (X11) input event handler
00546 
00547 
00548 #endif

Generated on Tue Jul 5 14:10:32 2011 for ROOT_528-00b_version by  doxygen 1.5.1