Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TSystem.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Fons Rademakers 15/09/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSystem
13 #define ROOT_TSystem
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TSystem //
19 // //
20 // Abstract base class defining a generic interface to the underlying //
21 // Operating System. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef __CINT__
26 #include <stdio.h>
27 #include <ctype.h>
28 #include <fcntl.h>
29 #ifndef WIN32
30 #include <unistd.h>
31 #endif
32 #endif
33 
34 #include "TNamed.h"
35 #include "TString.h"
36 #include "TInetAddress.h"
37 #include "TTimer.h"
38 #include "ThreadLocalStorage.h"
39 
40 class TSeqCollection;
41 class TFdSet;
42 class TVirtualMutex;
43 
44 enum EAccessMode {
45  kFileExists = 0,
46  kExecutePermission = 1,
47  kWritePermission = 2,
48  kReadPermission = 4
49 };
50 
51 enum ELogOption {
52  kLogPid = 0x01,
53  kLogCons = 0x02
54 };
55 
56 enum ELogLevel {
57  kLogEmerg = 0,
58  kLogAlert = 1,
59  kLogCrit = 2,
60  kLogErr = 3,
61  kLogWarning = 4,
62  kLogNotice = 5,
63  kLogInfo = 6,
64  kLogDebug = 7
65 };
66 
67 enum ELogFacility {
68  kLogLocal0,
69  kLogLocal1,
70  kLogLocal2,
71  kLogLocal3,
72  kLogLocal4,
73  kLogLocal5,
74  kLogLocal6,
75  kLogLocal7
76 };
77 
78 enum EFpeMask {
79  kNoneMask = 0x00,
80  kInvalid = 0x01, // Invalid argument
81  kDivByZero = 0x02, // Division by zero
82  kOverflow = 0x04, // Overflow
83  kUnderflow = 0x08, // Underflow
84  kInexact = 0x10, // Inexact
85  kDefaultMask = 0x07,
86  kAllMask = 0x1F
87 };
88 
89 enum EFileModeMask {
90  kS_IFMT = 0170000, // bitmask for the file type bitfields
91  kS_IFSOCK = 0140000, // socket
92  kS_IFLNK = 0120000, // symbolic link
93  kS_IFOFF = 0110000, // offline file
94  kS_IFREG = 0100000, // regular file
95  kS_IFBLK = 0060000, // block device
96  kS_IFDIR = 0040000, // directory
97  kS_IFCHR = 0020000, // character device
98  kS_IFIFO = 0010000, // fifo
99  kS_ISUID = 0004000, // set UID bit
100  kS_ISGID = 0002000, // set GID bit
101  kS_ISVTX = 0001000, // sticky bit
102  kS_IRWXU = 00700, // mask for file owner permissions
103  kS_IRUSR = 00400, // owner has read permission
104  kS_IWUSR = 00200, // owner has write permission
105  kS_IXUSR = 00100, // owner has execute permission
106  kS_IRWXG = 00070, // mask for group permissions
107  kS_IRGRP = 00040, // group has read permission
108  kS_IWGRP = 00020, // group has write permission
109  kS_IXGRP = 00010, // group has execute permission
110  kS_IRWXO = 00007, // mask for permissions for others (not in group)
111  kS_IROTH = 00004, // others have read permission
112  kS_IWOTH = 00002, // others have write permisson
113  kS_IXOTH = 00001 // others have execute permission
114 };
115 
116 inline Bool_t R_ISDIR(Int_t mode) { return ((mode & kS_IFMT) == kS_IFDIR); }
117 inline Bool_t R_ISCHR(Int_t mode) { return ((mode & kS_IFMT) == kS_IFCHR); }
118 inline Bool_t R_ISBLK(Int_t mode) { return ((mode & kS_IFMT) == kS_IFBLK); }
119 inline Bool_t R_ISREG(Int_t mode) { return ((mode & kS_IFMT) == kS_IFREG); }
120 inline Bool_t R_ISLNK(Int_t mode) { return ((mode & kS_IFMT) == kS_IFLNK); }
121 inline Bool_t R_ISFIFO(Int_t mode) { return ((mode & kS_IFMT) == kS_IFIFO); }
122 inline Bool_t R_ISSOCK(Int_t mode) { return ((mode & kS_IFMT) == kS_IFSOCK); }
123 inline Bool_t R_ISOFF(Int_t mode) { return ((mode & kS_IFMT) == kS_IFOFF); }
124 
125 struct FileStat_t {
126  Long_t fDev; // device id
127  Long_t fIno; // inode
128  Int_t fMode; // protection (combination of EFileModeMask bits)
129  Int_t fUid; // user id of owner
130  Int_t fGid; // group id of owner
131  Long64_t fSize; // total size in bytes
132  Long_t fMtime; // modification date
133  Bool_t fIsLink; // symbolic link
134  TString fUrl; // end point url of file
135  FileStat_t() : fDev(0), fIno(0), fMode(0), fUid(0), fGid(0), fSize(0),
136  fMtime(0), fIsLink(kFALSE), fUrl("") { }
137 };
138 
139 struct UserGroup_t {
140  Int_t fUid; // user id
141  Int_t fGid; // group id
142  TString fUser; // user name
143  TString fGroup; // group name
144  TString fPasswd; // password
145  TString fRealName; // user full name
146  TString fShell; // user preferred shell
147  UserGroup_t() : fUid(0), fGid(0), fUser(), fGroup(), fPasswd(),
148  fRealName (), fShell() { }
149 };
150 
151 struct SysInfo_t {
152  TString fOS; // OS
153  TString fModel; // computer model
154  TString fCpuType; // type of cpu
155  Int_t fCpus; // number of cpus
156  Int_t fCpuSpeed; // cpu speed in MHz
157  Int_t fBusSpeed; // bus speed in MHz
158  Int_t fL2Cache; // level 2 cache size in KB
159  Int_t fPhysRam; // physical RAM in MB
160  SysInfo_t() : fOS(), fModel(), fCpuType(), fCpus(0), fCpuSpeed(0),
161  fBusSpeed(0), fL2Cache(0), fPhysRam(0) { }
162  virtual ~SysInfo_t() { }
163  ClassDef(SysInfo_t, 1); // System information - OS, CPU, RAM.
164 };
165 
166 struct CpuInfo_t {
167  Float_t fLoad1m; // cpu load average over 1 m
168  Float_t fLoad5m; // cpu load average over 5 m
169  Float_t fLoad15m; // cpu load average over 15 m
170  Float_t fUser; // cpu user load in percentage
171  Float_t fSys; // cpu sys load in percentage
172  Float_t fTotal; // cpu user+sys load in percentage
173  Float_t fIdle; // cpu idle percentage
174  CpuInfo_t() : fLoad1m(0), fLoad5m(0), fLoad15m(0),
175  fUser(0), fSys(0), fTotal(0), fIdle(0) { }
176  virtual ~CpuInfo_t() { }
177  ClassDef(CpuInfo_t, 1); // CPU load information.
178 };
179 
180 struct MemInfo_t {
181  Int_t fMemTotal; // total RAM in MB
182  Int_t fMemUsed; // used RAM in MB
183  Int_t fMemFree; // free RAM in MB
184  Int_t fSwapTotal; // total swap in MB
185  Int_t fSwapUsed; // used swap in MB
186  Int_t fSwapFree; // free swap in MB
187  MemInfo_t() : fMemTotal(0), fMemUsed(0), fMemFree(0),
188  fSwapTotal(0), fSwapUsed(0), fSwapFree(0) { }
189  virtual ~MemInfo_t() { }
190  ClassDef(MemInfo_t, 1); // Memory utilization information.
191 };
192 
193 struct ProcInfo_t {
194  Float_t fCpuUser; // user time used by this process in seconds
195  Float_t fCpuSys; // system time used by this process in seconds
196  Long_t fMemResident; // resident memory used by this process in KB
197  Long_t fMemVirtual; // virtual memory used by this process in KB
198  ProcInfo_t() : fCpuUser(0), fCpuSys(0), fMemResident(0),
199  fMemVirtual(0) { }
200  virtual ~ProcInfo_t();
201  ClassDef(ProcInfo_t, 1);// System resource usage of given process.
202 };
203 
204 struct RedirectHandle_t {
205  TString fFile; // File where the output was redirected
206  TString fStdOutTty; // tty associated with stdout, if any (e.g. from ttyname(...))
207  TString fStdErrTty; // tty associated with stderr, if any (e.g. from ttyname(...))
208  Int_t fStdOutDup; // Duplicated descriptor for stdout
209  Int_t fStdErrDup; // Duplicated descriptor for stderr
210  Int_t fReadOffSet; // Offset where to start reading the file (used by ShowOutput(...))
211  RedirectHandle_t(const char *n = 0) : fFile(n), fStdOutTty(), fStdErrTty(), fStdOutDup(-1),
212  fStdErrDup(-1), fReadOffSet(-1) { }
213  void Reset() { fFile = ""; fStdOutTty = ""; fStdErrTty = "";
214  fStdOutDup = -1; fStdErrDup = -1; fReadOffSet = -1; }
215 };
216 
217 enum ESockOptions {
218  kSendBuffer, // size of send buffer
219  kRecvBuffer, // size of receive buffer
220  kOobInline, // OOB message inline
221  kKeepAlive, // keep socket alive
222  kReuseAddr, // allow reuse of local portion of address 5-tuple
223  kNoDelay, // send without delay
224  kNoBlock, // non-blocking I/O
225  kProcessGroup, // socket process group (used for SIGURG and SIGIO)
226  kAtMark, // are we at out-of-band mark (read only)
227  kBytesToRead // get number of bytes to read, FIONREAD (read only)
228 };
229 
230 enum ESendRecvOptions {
231  kDefault, // default option (= 0)
232  kOob, // send or receive out-of-band data
233  kPeek, // peek at incoming message (receive only)
234  kDontBlock // send/recv as much data as possible without blocking
235 };
236 
237 #ifdef __CINT__
238 typedef void *Func_t;
239 #else
240 typedef void ((*Func_t)());
241 #endif
242 
243 R__EXTERN const char *gRootDir;
244 R__EXTERN const char *gProgName;
245 R__EXTERN const char *gProgPath;
246 R__EXTERN TVirtualMutex *gSystemMutex;
247 
248 
249 //////////////////////////////////////////////////////////////////////////
250 // //
251 // Asynchronous timer used for processing pending GUI and timer events //
252 // every delay ms. Call in a tight computing loop //
253 // TProcessEventTimer::ProcessEvent(). If the timer did timeout this //
254 // call will process the pending events and return kTRUE if the //
255 // TROOT::IsInterrupted() flag is set (can be done by hitting key in //
256 // canvas or selecting canvas menu item View/Interrupt. //
257 // //
258 //////////////////////////////////////////////////////////////////////////
259 class TProcessEventTimer : public TTimer {
260 public:
261  TProcessEventTimer(Long_t delay);
262  Bool_t Notify() { return kTRUE; }
263  Bool_t ProcessEvents();
264  ClassDef(TProcessEventTimer,0) // Process pending events at fixed time intervals
265 };
266 
267 
268 class TSystem : public TNamed {
269 
270 public:
271  enum EAclicMode { kDefault, kDebug, kOpt };
272  enum EAclicProperties {
273  kFlatBuildDir = BIT(0) // If set and a BuildDir is selected, then do not created subdirectories
274  };
275 
276 protected:
277  TFdSet *fReadmask; //!Files that should be checked for read events
278  TFdSet *fWritemask; //!Files that should be checked for write events
279  TFdSet *fReadready; //!Files with reads waiting
280  TFdSet *fWriteready; //!Files with writes waiting
281  TFdSet *fSignals; //!Signals that were trapped
282  Int_t fNfd; //Number of fd's in masks
283  Int_t fMaxrfd; //Largest fd in read mask
284  Int_t fMaxwfd; //Largest fd in write mask
285  Int_t fSigcnt; //Number of pending signals
286  TString fWdpath; //Working directory
287  TString fHostname; //Hostname
288  Bool_t fInsideNotify; //Used by DispatchTimers()
289  Int_t fBeepFreq; //Used by Beep()
290  Int_t fBeepDuration; //Used by Beep()
291 
292  Bool_t fInControl; //True if in eventloop
293  Bool_t fDone; //True if eventloop should be finished
294  Int_t fLevel; //Level of nested eventloops
295 
296  TSeqCollection *fTimers; //List of timers
297  TSeqCollection *fSignalHandler; //List of signal handlers
298  TSeqCollection *fFileHandler; //List of file handlers
299  TSeqCollection *fStdExceptionHandler; //List of std::exception handlers
300  TSeqCollection *fOnExitList; //List of items to be cleaned-up on exit
301 
302  TString fListLibs; //List shared libraries, cache used by GetLibraries
303 
304  TString fBuildArch; //Architecure for which ROOT was built (passed to ./configure)
305  TString fBuildCompiler; // Compiler used to build this ROOT
306  TString fBuildCompilerVersion; //Compiler version used to build this ROOT
307  TString fBuildNode; //Detailed information where ROOT was built
308  TString fBuildDir; //Location where to build ACLiC shared library and use as scratch area.
309  TString fFlagsDebug; //Flags for debug compilation
310  TString fFlagsOpt; //Flags for optimized compilation
311  TString fListPaths; //List of all include (fIncludePath + interpreter include path). Cache used by GetIncludePath
312  TString fIncludePath; //Used to expand $IncludePath in the directives given to SetMakeSharedLib and SetMakeExe
313  TString fLinkedLibs; //Used to expand $LinkedLibs in the directives given to SetMakeSharedLib and SetMakeExe
314  TString fSoExt; //Extension of shared library (.so, .sl, .a, .dll, etc.)
315  TString fObjExt; //Extension of object files (.o, .obj, etc.)
316  EAclicMode fAclicMode; //Whether the compilation should be done debug or opt
317  TString fMakeSharedLib; //Directive used to build a shared library
318  TString fMakeExe; //Directive used to build an executable
319  TString fLinkdefSuffix; //Default suffix for linkdef files to be used by ACLiC (see EACLiCProperties)
320  Int_t fAclicProperties; //Various boolean flag for change ACLiC's behavior.
321  TSeqCollection *fCompiled; //List of shared libs from compiled macros to be deleted
322  TSeqCollection *fHelpers; //List of helper classes for alternative file/directory access
323 
324  TString &GetLastErrorString(); //Last system error message (thread local).
325  const TString &GetLastErrorString() const; //Last system error message (thread local).
326 
327  TSystem *FindHelper(const char *path, void *dirptr = 0);
328  virtual Bool_t ConsistentWith(const char *path, void *dirptr = 0);
329  virtual const char *ExpandFileName(const char *fname);
330  virtual Bool_t ExpandFileName(TString &fname);
331  virtual void SigAlarmInterruptsSyscalls(Bool_t) { }
332  virtual const char *GetLinkedLibraries();
333  virtual void DoBeep(Int_t /*freq*/=-1, Int_t /*duration*/=-1) const { printf("\a"); fflush(stdout); }
334 
335  static const char *StripOffProto(const char *path, const char *proto) {
336  return !strncmp(path, proto, strlen(proto)) ? path + strlen(proto) : path;
337  }
338 
339 private:
340  TSystem(const TSystem&); // not implemented
341  TSystem& operator=(const TSystem&); // not implemented
342  Bool_t ExpandFileName(const char *fname, char *xname, const int kBufSize);
343 
344 public:
345  TSystem(const char *name = "Generic", const char *title = "Generic System");
346  virtual ~TSystem();
347 
348  //---- Misc
349  virtual Bool_t Init();
350  virtual void SetProgname(const char *name);
351  virtual void SetDisplay();
352  void SetErrorStr(const char *errstr);
353  const char *GetErrorStr() const { return GetLastErrorString(); }
354  virtual const char *GetError();
355  void RemoveOnExit(TObject *obj);
356  virtual const char *HostName();
357  virtual void NotifyApplicationCreated();
358 
359  static Int_t GetErrno();
360  static void ResetErrno();
361  void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE);
362  void GetBeepDefaults(Int_t &freq, Int_t &duration) const { freq = fBeepFreq; duration = fBeepDuration; }
363 
364  //---- EventLoop
365  virtual void Run();
366  virtual Bool_t ProcessEvents();
367  virtual void DispatchOneEvent(Bool_t pendingOnly = kFALSE);
368  virtual void ExitLoop();
369  Bool_t InControl() const { return fInControl; }
370  virtual void InnerLoop();
371  virtual Int_t Select(TList *active, Long_t timeout);
372  virtual Int_t Select(TFileHandler *fh, Long_t timeout);
373 
374  //---- Handling of system events
375  virtual void AddSignalHandler(TSignalHandler *sh);
376  virtual TSignalHandler *RemoveSignalHandler(TSignalHandler *sh);
377  virtual void ResetSignal(ESignals sig, Bool_t reset = kTRUE);
378  virtual void ResetSignals();
379  virtual void IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE);
380  virtual void IgnoreInterrupt(Bool_t ignore = kTRUE);
381  virtual TSeqCollection *GetListOfSignalHandlers() const { return fSignalHandler; }
382  virtual void AddFileHandler(TFileHandler *fh);
383  virtual TFileHandler *RemoveFileHandler(TFileHandler *fh);
384  virtual TSeqCollection *GetListOfFileHandlers() const { return fFileHandler; }
385  virtual void AddStdExceptionHandler(TStdExceptionHandler *eh);
386  virtual TStdExceptionHandler *RemoveStdExceptionHandler(TStdExceptionHandler *eh);
387  virtual TSeqCollection *GetListOfStdExceptionHandlers() const { return fStdExceptionHandler; }
388 
389  //---- Floating Point Exceptions Control
390  virtual Int_t GetFPEMask();
391  virtual Int_t SetFPEMask(Int_t mask = kDefaultMask);
392 
393  //---- Time & Date
394  virtual TTime Now();
395  virtual TSeqCollection *GetListOfTimers() const { return fTimers; }
396  virtual void AddTimer(TTimer *t);
397  virtual TTimer *RemoveTimer(TTimer *t);
398  virtual void ResetTimer(TTimer *) { }
399  virtual Long_t NextTimeOut(Bool_t mode);
400  virtual void Sleep(UInt_t milliSec);
401 
402  //---- Processes
403  virtual Int_t Exec(const char *shellcmd);
404  virtual FILE *OpenPipe(const char *command, const char *mode);
405  virtual int ClosePipe(FILE *pipe);
406  virtual TString GetFromPipe(const char *command);
407  virtual void Exit(int code, Bool_t mode = kTRUE);
408  virtual void Abort(int code = 0);
409  virtual int GetPid();
410  virtual void StackTrace();
411 
412  //---- Directories
413  virtual int MakeDirectory(const char *name);
414  virtual void *OpenDirectory(const char *name);
415  virtual void FreeDirectory(void *dirp);
416  virtual const char *GetDirEntry(void *dirp);
417  virtual void *GetDirPtr() const { return 0; }
418  virtual Bool_t ChangeDirectory(const char *path);
419  virtual const char *WorkingDirectory();
420  virtual std::string GetWorkingDirectory() const;
421  virtual const char *HomeDirectory(const char *userName = 0);
422  virtual std::string GetHomeDirectory(const char *userName = 0) const;
423  virtual int mkdir(const char *name, Bool_t recursive = kFALSE);
424  Bool_t cd(const char *path) { return ChangeDirectory(path); }
425  const char *pwd() { return WorkingDirectory(); }
426  virtual const char *TempDirectory() const;
427  virtual FILE *TempFileName(TString &base, const char *dir = 0);
428 
429  //---- Paths & Files
430  virtual const char *BaseName(const char *pathname);
431  virtual const char *DirName(const char *pathname);
432  virtual char *ConcatFileName(const char *dir, const char *name);
433  virtual Bool_t IsAbsoluteFileName(const char *dir);
434  virtual Bool_t IsFileInIncludePath(const char *name, char **fullpath = 0);
435  virtual const char *PrependPathName(const char *dir, TString& name);
436  virtual Bool_t ExpandPathName(TString &path);
437  virtual char *ExpandPathName(const char *path);
438  virtual Bool_t AccessPathName(const char *path, EAccessMode mode = kFileExists);
439  virtual Bool_t IsPathLocal(const char *path);
440  virtual int CopyFile(const char *from, const char *to, Bool_t overwrite = kFALSE);
441  virtual int Rename(const char *from, const char *to);
442  virtual int Link(const char *from, const char *to);
443  virtual int Symlink(const char *from, const char *to);
444  virtual int Unlink(const char *name);
445  int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
446  int GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
447  virtual int GetPathInfo(const char *path, FileStat_t &buf);
448  virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree);
449  virtual int Chmod(const char *file, UInt_t mode);
450  virtual int Umask(Int_t mask);
451  virtual int Utime(const char *file, Long_t modtime, Long_t actime);
452  virtual const char *UnixPathName(const char *unixpathname);
453  virtual const char *FindFile(const char *search, TString& file, EAccessMode mode = kFileExists);
454  virtual char *Which(const char *search, const char *file, EAccessMode mode = kFileExists);
455  virtual TList *GetVolumes(Option_t *) const { return 0; }
456 
457  //---- Users & Groups
458  virtual Int_t GetUid(const char *user = 0);
459  virtual Int_t GetGid(const char *group = 0);
460  virtual Int_t GetEffectiveUid();
461  virtual Int_t GetEffectiveGid();
462  virtual UserGroup_t *GetUserInfo(Int_t uid);
463  virtual UserGroup_t *GetUserInfo(const char *user = 0);
464  virtual UserGroup_t *GetGroupInfo(Int_t gid);
465  virtual UserGroup_t *GetGroupInfo(const char *group = 0);
466 
467  //---- Environment Manipulation
468  virtual void Setenv(const char *name, const char *value);
469  virtual void Unsetenv(const char *name);
470  virtual const char *Getenv(const char *env);
471 
472  //---- System Logging
473  virtual void Openlog(const char *name, Int_t options, ELogFacility facility);
474  virtual void Syslog(ELogLevel level, const char *mess);
475  virtual void Closelog();
476 
477  //---- Standard Output redirection
478  virtual Int_t RedirectOutput(const char *name, const char *mode = "a", RedirectHandle_t *h = 0);
479  virtual void ShowOutput(RedirectHandle_t *h);
480 
481  //---- Dynamic Loading
482  virtual void AddDynamicPath(const char *pathname);
483  virtual const char *GetDynamicPath();
484  virtual void SetDynamicPath(const char *pathname);
485  char *DynamicPathName(const char *lib, Bool_t quiet = kFALSE);
486  virtual const char *FindDynamicLibrary(TString& lib, Bool_t quiet = kFALSE);
487  virtual Func_t DynFindSymbol(const char *module, const char *entry);
488  virtual int Load(const char *module, const char *entry = "", Bool_t system = kFALSE);
489  virtual void Unload(const char *module);
490  virtual UInt_t LoadAllLibraries();
491  virtual void ListSymbols(const char *module, const char *re = "");
492  virtual void ListLibraries(const char *regexp = "");
493  virtual const char *GetLibraries(const char *regexp = "",
494  const char *option = "",
495  Bool_t isRegexp = kTRUE);
496 
497  //---- RPC
498  virtual TInetAddress GetHostByName(const char *server);
499  virtual TInetAddress GetPeerName(int sock);
500  virtual TInetAddress GetSockName(int sock);
501  virtual int GetServiceByName(const char *service);
502  virtual char *GetServiceByPort(int port);
503  virtual int OpenConnection(const char *server, int port, int tcpwindowsize = -1, const char *protocol = "tcp");
504  virtual int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1);
505  virtual int AnnounceUdpService(int port, int backlog);
506  virtual int AnnounceUnixService(int port, int backlog);
507  virtual int AnnounceUnixService(const char *sockpath, int backlog);
508  virtual int AcceptConnection(int sock);
509  virtual void CloseConnection(int sock, Bool_t force = kFALSE);
510  virtual int RecvRaw(int sock, void *buffer, int length, int flag);
511  virtual int SendRaw(int sock, const void *buffer, int length, int flag);
512  virtual int RecvBuf(int sock, void *buffer, int length);
513  virtual int SendBuf(int sock, const void *buffer, int length);
514  virtual int SetSockOpt(int sock, int kind, int val);
515  virtual int GetSockOpt(int sock, int kind, int *val);
516 
517  //---- System, CPU and Memory info
518  virtual int GetSysInfo(SysInfo_t *info) const;
519  virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime = 1000) const;
520  virtual int GetMemInfo(MemInfo_t *info) const;
521  virtual int GetProcInfo(ProcInfo_t *info) const;
522 
523  //---- ACLiC (Automatic Compiler of Shared Library for CINT)
524  virtual void AddIncludePath(const char *includePath);
525  virtual void AddLinkedLibs(const char *linkedLib);
526  virtual int CompileMacro(const char *filename, Option_t *opt="", const char* library_name = "", const char* build_dir = "", UInt_t dirmode = 0);
527  virtual Int_t GetAclicProperties() const;
528  virtual const char *GetBuildArch() const;
529  virtual const char *GetBuildCompiler() const;
530  virtual const char *GetBuildCompilerVersion() const;
531  virtual const char *GetBuildNode() const;
532  virtual const char *GetBuildDir() const;
533  virtual const char *GetFlagsDebug() const;
534  virtual const char *GetFlagsOpt() const;
535  virtual const char *GetIncludePath();
536  virtual const char *GetLinkedLibs() const;
537  virtual const char *GetLinkdefSuffix() const;
538  virtual EAclicMode GetAclicMode() const;
539  virtual const char *GetMakeExe() const;
540  virtual const char *GetMakeSharedLib() const;
541  virtual const char *GetSoExt() const;
542  virtual const char *GetObjExt() const;
543  virtual void SetBuildDir(const char* build_dir, Bool_t isflat = kFALSE);
544  virtual void SetFlagsDebug(const char *);
545  virtual void SetFlagsOpt(const char *);
546  virtual void SetIncludePath(const char *includePath);
547  virtual void SetMakeExe(const char *directives);
548  virtual void SetAclicMode(EAclicMode mode);
549  virtual void SetMakeSharedLib(const char *directives);
550  virtual void SetLinkedLibs(const char *linkedLibs);
551  virtual void SetLinkdefSuffix(const char *suffix);
552  virtual void SetSoExt(const char *soExt);
553  virtual void SetObjExt(const char *objExt);
554  virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const;
555  virtual void CleanCompiledMacros();
556 
557  ClassDef(TSystem,0) //ABC defining a generic interface to the OS
558 };
559 
560 R__EXTERN TSystem *gSystem;
561 R__EXTERN TFileHandler *gXDisplay; // Display server (X11) input event handler
562 
563 
564 #endif