40 #ifndef ROOT_TInetAddress
46 #ifndef ROOT_ThreadLocalStorage
145 FileStat_t() : fDev(0), fIno(0), fMode(0), fUid(0), fGid(0), fSize(0),
146 fMtime(0), fIsLink(
kFALSE), fUrl(
"") { }
158 fRealName (), fShell() { }
170 SysInfo_t() : fOS(), fModel(), fCpuType(), fCpus(0), fCpuSpeed(0),
171 fBusSpeed(0), fL2Cache(0), fPhysRam(0) { }
185 fUser(0), fSys(0), fTotal(0), fIdle(0) { }
198 fSwapTotal(0), fSwapUsed(0), fSwapFree(0) { }
222 fStdErrDup(-1), fReadOffSet(-1) { }
223 void Reset() { fFile =
""; fStdOutTty =
""; fStdErrTty =
"";
224 fStdOutDup = -1; fStdErrDup = -1; fReadOffSet = -1; }
228 typedef void *Func_t;
230 typedef void ((*Func_t)());
326 return !strncmp(path, proto, strlen(proto)) ? path + strlen(proto) : path;
335 TSystem(
const char *
name =
"Generic",
const char *title =
"Generic System");
393 virtual Int_t Exec(
const char *shellcmd);
394 virtual FILE *
OpenPipe(
const char *command,
const char *mode);
398 virtual void Abort(
int code = 0);
420 virtual const char *
BaseName(
const char *pathname);
421 virtual const char *
DirName(
const char *pathname);
431 virtual int Rename(
const char *from,
const char *to);
432 virtual int Link(
const char *from,
const char *to);
433 virtual int Symlink(
const char *from,
const char *to);
442 virtual const char *
UnixPathName(
const char *unixpathname);
460 virtual const char *
Getenv(
const char *env);
479 virtual void Unload(
const char *module);
480 virtual void ListSymbols(
const char *module,
const char *re =
"");
482 virtual const char *
GetLibraries(
const char *regexp =
"",
483 const char *option =
"",
492 virtual int OpenConnection(
const char *server,
int port,
int tcpwindowsize = -1,
const char *protocol =
"tcp");
499 virtual int RecvRaw(
int sock,
void *buffer,
int length,
int flag);
500 virtual int SendRaw(
int sock,
const void *buffer,
int length,
int flag);
502 virtual int SendBuf(
int sock,
const void *buffer,
int length);
503 virtual int SetSockOpt(
int sock,
int kind,
int val);
504 virtual int GetSockOpt(
int sock,
int kind,
int *val);
530 virtual const char *
GetSoExt()
const;
536 virtual void SetMakeExe(
const char *directives);
541 virtual void SetSoExt(
const char *soExt);
542 virtual void SetObjExt(
const char *objExt);
Bool_t R_ISSOCK(Int_t mode)
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
TSeqCollection * fCompiled
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form: ~~~ {.cpp} [path/]macro.C[+|++[k|f|g|O|c|s|d|v|-]][(args)]...
virtual int GetPid()
Get process id.
Bool_t R_ISCHR(Int_t mode)
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Syslog(ELogLevel level, const char *mess)
Send mess to syslog daemon.
Bool_t R_ISLNK(Int_t mode)
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
Bool_t ProcessEvents()
Process events if timer did time out.
virtual const char * WorkingDirectory()
Return working directory.
virtual void StackTrace()
Print a stack trace.
virtual TSeqCollection * GetListOfStdExceptionHandlers() const
virtual const char * GetBuildCompiler() const
Return the build compiler.
virtual void SigAlarmInterruptsSyscalls(Bool_t)
virtual void SetFlagsDebug(const char *)
FlagsDebug should contain the options to pass to the C++ compiler in order to compile the library in ...
virtual void NotifyApplicationCreated()
Hook to tell TSystem that the TApplication object has been created.
R__EXTERN TVirtualMutex * gSystemMutex
virtual const char * GetLinkdefSuffix() const
Return the linkdef suffix chosen by the user for ACLiC.
virtual int Link(const char *from, const char *to)
Create a link from file1 to file2.
virtual const char * GetBuildArch() const
Return the build architecture.
virtual void SetFlagsOpt(const char *)
FlagsOpt should contain the options to pass to the C++ compiler in order to compile the library in op...
virtual const char * GetLinkedLibraries()
Get list of shared libraries loaded at the start of the executable.
TSeqCollection * fOnExitList
void RemoveOnExit(TObject *obj)
Objects that should be deleted on exit of the OS interface.
virtual Int_t SetFPEMask(Int_t mask=kDefaultMask)
Set which conditions trigger a floating point exception.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
TString fBuildCompilerVersion
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
This class represents an Internet Protocol (IP) address.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket connection.
This class implements a mutex interface.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
static const char * filename()
virtual UserGroup_t * GetGroupInfo(Int_t gid)
Returns all group info in the UserGroup_t structure.
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks...
virtual void SetMakeExe(const char *directives)
Directives has the same syntax as the argument of SetMakeSharedLib but is used to create an executabl...
Bool_t cd(const char *path)
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void AddStdExceptionHandler(TStdExceptionHandler *eh)
Add an exception handler to list of system exception handlers.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
virtual TSeqCollection * GetListOfFileHandlers() const
TSeqCollection * fSignalHandler
virtual void ResetSignal(ESignals sig, Bool_t reset=kTRUE)
If reset is true reset the signal handler for the specified signal to the default handler...
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual void SetMakeSharedLib(const char *directives)
Directives should contain the description on how to compile and link a shared lib.
virtual int AnnounceUdpService(int port, int backlog)
Announce UDP service.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
Basic time type with millisecond precision.
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
virtual EAclicMode GetAclicMode() const
AclicMode indicates whether the library should be built in debug mode or optimized.
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
virtual int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
Bool_t R_ISREG(Int_t mode)
virtual char * GetServiceByPort(int port)
Get name of internet service.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
TSystem & operator=(const TSystem &)
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
static Int_t GetErrno()
Static function returning system error number.
TSeqCollection * fStdExceptionHandler
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual void * GetDirPtr() const
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Sequenceable collection abstract base class.
#define ClassDef(name, id)
virtual FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual TSeqCollection * GetListOfTimers() const
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
The TNamed class is the base class for all named ROOT classes.
TSeqCollection * fHelpers
virtual const char * GetLinkedLibs() const
Return the list of library linked to this executable.
R__EXTERN TFileHandler * gXDisplay
Int_t fNfd
Signals that were trapped.
virtual const char * GetDynamicPath()
Return the dynamic path (used to find shared libraries).
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void ListLibraries(const char *regexp="")
List all loaded shared libraries.
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
virtual void SetDisplay()
Set DISPLAY environment variable based on utmp entry. Only for UNIX.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual void ExitLoop()
Exit from event loop.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
virtual int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
virtual ~TSystem()
Delete the OS interface.
virtual void Unload(const char *module)
Unload a shared library.
virtual Bool_t ConsistentWith(const char *path, void *dirptr=0)
Check consistency of this helper with the one required by 'path' or 'dirptr'.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
virtual void Closelog()
Close connection to system log daemon.
virtual const char * GetFlagsDebug() const
Return the debug flags.
TSeqCollection * fFileHandler
TString & GetLastErrorString()
Return the thread local storage for the custom last error message.
virtual const char * GetSoExt() const
Get the shared library extension.
R__EXTERN const char * gProgName
virtual void AddDynamicPath(const char *pathname)
Add a new directory to the dynamic path.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
virtual TStdExceptionHandler * RemoveStdExceptionHandler(TStdExceptionHandler *eh)
Remove an exception handler from list of exception handlers.
Double_t length(const TVector2 &v)
virtual Bool_t Init()
Initialize the OS interface.
R__EXTERN TSystem * gSystem
virtual const char * GetBuildNode() const
Return the build node name.
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
virtual int AcceptConnection(int sock)
Accept a connection.
virtual void SetDynamicPath(const char *pathname)
Set the dynamic path to a new value.
virtual int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1)
Announce TCP/IP service.
virtual Long_t NextTimeOut(Bool_t mode)
Time when next timer of mode (synchronous=kTRUE or asynchronous=kFALSE) will time-out (in ms)...
virtual int Umask(Int_t mask)
Set the process file creation mode mask.
static const char * StripOffProto(const char *path, const char *proto)
virtual void SetBuildDir(const char *build_dir, Bool_t isflat=kFALSE)
Set the location where ACLiC will create libraries and use as a scratch area.
virtual int SendBuf(int sock, const void *buffer, int length)
Send a buffer headed by a length indicator.
virtual std::string GetWorkingDirectory() const
Return working directory.
Handles synchronous and a-synchronous timer events.
virtual const char * GetBuildDir() const
Return the path of the build directory.
virtual void ListSymbols(const char *module, const char *re="")
List symbols in a shared library.
virtual const char * GetMakeExe() const
Return the command line use to make an executable.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
RedirectHandle_t(const char *n=0)
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual void Abort(int code=0)
Abort the application.
virtual void InnerLoop()
Inner event loop.
virtual void SetSoExt(const char *soExt)
Set shared library extension, should be either .so, .sl, .a, .dll, etc.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
virtual void Unsetenv(const char *name)
Unset environment variable.
virtual void ResetTimer(TTimer *)
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
virtual void Run()
System event loop.
virtual int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to another host.
virtual int SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
virtual const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE)
Find a dynamic library using the system search paths.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual TSeqCollection * GetListOfSignalHandlers() const
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual Int_t GetEffectiveUid()
Returns the effective user id.
virtual const char * GetIncludePath()
Get the list of include path.
TFdSet * fReadready
Files that should be checked for write events.
R__EXTERN const char * gProgPath
virtual const char * GetFlagsOpt() const
Return the optimization flags.
const char * GetErrorStr() const
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
virtual const char * HostName()
Return the system's host name.
void GetBeepDefaults(Int_t &freq, Int_t &duration) const
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
virtual const char * ExpandFileName(const char *fname)
Expand a pathname getting rid of special shell characters like ~.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
TFdSet * fSignals
Files with writes waiting.
virtual Int_t GetGid(const char *group=0)
Returns the group's id. If group = 0, returns current user's group.
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function.
virtual TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
virtual Int_t GetUid(const char *user=0)
Returns the user's id. If user = 0, returns current user's id.
virtual void AddLinkedLibs(const char *linkedLib)
Add linkedLib to already set linked libs.
virtual void SetAclicMode(EAclicMode mode)
AclicMode indicates whether the library should be built in debug mode or optimized.
Mother of all ROOT objects.
virtual void SetObjExt(const char *objExt)
Set object files extension, should be either .o, .obj, etc.
virtual Bool_t IsFileInIncludePath(const char *name, char **fullpath=0)
Return true if 'name' is a file that can be found in the ROOT include path or the current directory...
virtual Int_t GetAclicProperties() const
Return the ACLiC properties field.
typedef void((*Func_t)())
virtual std::string GetHomeDirectory(const char *userName=0) const
Return the user's home directory.
virtual int RecvBuf(int sock, void *buffer, int length)
Receive a buffer headed by a length indicator.
virtual void Openlog(const char *name, Int_t options, ELogFacility facility)
Open connection to system log daemon.
Bool_t R_ISDIR(Int_t mode)
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual int AnnounceUnixService(int port, int backlog)
Announce unix domain service.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'...
virtual void SetLinkedLibs(const char *linkedLibs)
LinkedLibs should contain the library directory and list of libraries needed to recreate the current ...
R__EXTERN const char * gRootDir
virtual Int_t GetEffectiveGid()
Returns the effective group id.
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
virtual const char * GetObjExt() const
Get the object file extension.
virtual TList * GetVolumes(Option_t *) const
Bool_t R_ISBLK(Int_t mode)
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual void AddIncludePath(const char *includePath)
Add includePath to the already set include path.
TSystem * FindHelper(const char *path, void *dirptr=0)
Create helper TSystem to handle file and directory operations that might be special for remote file a...
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
static void ResetErrno()
Static function resetting system error number.
virtual int GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
TFdSet * fWriteready
Files with reads waiting.
void SetErrorStr(const char *errstr)
Set the system error string.
virtual int GetSockOpt(int sock, int kind, int *val)
Get socket option.
Abstract base class defining a generic interface to the underlying Operating System.
Bool_t R_ISFIFO(Int_t mode)
virtual void SetLinkdefSuffix(const char *suffix)
The 'suffix' will be appended to the name of a script loaded by ACLiC and used to locate any eventual...
virtual Int_t GetFPEMask()
Return the bitmap of conditions that trigger a floating point exception.
TFdSet * fWritemask
Files that should be checked for read events.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Bool_t Notify()
Notify when timer times out.
virtual const char * GetError()
Return system error string.
virtual 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 s...
virtual void DoBeep(Int_t=-1, Int_t=-1) const
virtual void SetIncludePath(const char *includePath)
IncludePath should contain the list of compiler flags to indicate where to find user defined header f...
TProcessEventTimer(Long_t delay)
Bool_t R_ISOFF(Int_t mode)
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.