Logo ROOT  
Reference Guide
TUnixSystem.h
Go to the documentation of this file.
1 // @(#)root/unix:$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_TUnixSystem
13 #define ROOT_TUnixSystem
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TUnixSystem //
19 // //
20 // Class providing an interface to the UNIX Operating System. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TSystem.h"
25 #include "TSysEvtHandler.h"
26 #include "TTimer.h"
27 #include <string>
28 
30 
31 
32 class TUnixSystem : public TSystem {
33 
34 private:
35  void FillWithCwd(char *cwd) const;
36 
37 protected:
38  const char *GetLinkedLibraries() override;
39 
40  // static functions providing semi-low level interface to raw Unix
41  static int UnixMakedir(const char *name);
42  static void *UnixOpendir(const char *name);
43  static const char *UnixGetdirentry(void *dir);
44  static const char *UnixHomedirectory(const char *user = nullptr);
45  static const char *UnixHomedirectory(const char *user, char *path, char *mydir);
46  static Long64_t UnixNow();
47  static int UnixWaitchild();
48  static int UnixSetitimer(Long_t ms);
49  static int UnixSelect(Int_t nfds, TFdSet *readready, TFdSet *writeready,
50  Long_t timeout);
51  static void UnixSignal(ESignals sig, SigHandler_t h);
52  static const char *UnixSigname(ESignals sig);
53  static void UnixSigAlarmInterruptsSyscalls(Bool_t set);
54  static void UnixResetSignal(ESignals sig);
55  static void UnixResetSignals();
56  static void UnixIgnoreSignal(ESignals sig, Bool_t ignore);
57  static int UnixFilestat(const char *path, FileStat_t &buf);
58  static int UnixFSstat(const char *path, Long_t *id, Long_t *bsize,
59  Long_t *blocks, Long_t *bfree);
60  static int UnixTcpConnect(const char *hostname, int port, int tcpwindowsize);
61  static int UnixUdpConnect(const char *hostname, int port);
62  static int UnixUnixConnect(int port);
63  static int UnixUnixConnect(const char *path);
64  static int UnixTcpService(int port, Bool_t reuse, int backlog,
65  int tcpwindowsize);
66  static int UnixUdpService(int port, int backlog);
67  static int UnixUnixService(int port, int backlog);
68  static int UnixUnixService(const char *sockpath, int backlog);
69  static int UnixRecv(int sock, void *buf, int len, int flag);
70  static int UnixSend(int sock, const void *buf, int len, int flag);
71 
72 public:
73  TUnixSystem();
74  virtual ~TUnixSystem();
75 
76  //---- Misc -------------------------------------------------
77  Bool_t Init() override;
78  void SetProgname(const char *name) override;
79  void SetDisplay() override;
80  const char *GetError() override;
81  const char *HostName() override;
82 
83  //---- EventLoop --------------------------------------------
84  void DispatchOneEvent(Bool_t pendingOnly = kFALSE) override;
85  Int_t Select(TList *active, Long_t timeout) override;
86  Int_t Select(TFileHandler *fh, Long_t timeout) override;
87 
88  //---- Handling of system events ----------------------------
89  void CheckChilds();
92  void DispatchSignals(ESignals sig);
93  void AddSignalHandler(TSignalHandler *sh) override;
95  void ResetSignal(ESignals sig, Bool_t reset = kTRUE) override;
96  void ResetSignals() override;
97  void IgnoreSignal(ESignals sig, Bool_t ignore = kTRUE) override;
98  void SigAlarmInterruptsSyscalls(Bool_t set) override;
99  void AddFileHandler(TFileHandler *fh) override;
101 
102  //---- Floating Point Exceptions Control --------------------
103  Int_t GetFPEMask() override;
104  Int_t SetFPEMask(Int_t mask = kDefaultMask) override;
105 
106  //---- Time & Date ------------------------------------------
107  TTime Now() override;
108  void AddTimer(TTimer *ti) override;
109  TTimer *RemoveTimer(TTimer *ti) override;
110  void ResetTimer(TTimer *ti) override;
112  void Sleep(UInt_t milliSec) override;
113 
114  //---- Processes --------------------------------------------
115  Int_t Exec(const char *shellcmd) override;
116  FILE *OpenPipe(const char *shellcmd, const char *mode) override;
117  int ClosePipe(FILE *pipe) override;
118  void Exit(int code, Bool_t mode = kTRUE) override;
119  void Abort(int code = 0) override;
120  int GetPid() override;
121  void StackTrace() override;
122 
123  //---- Directories ------------------------------------------
124  int MakeDirectory(const char *name) override;
125  void *OpenDirectory(const char *name) override;
126  void FreeDirectory(void *dirp) override;
127  const char *GetDirEntry(void *dirp) override;
128  Bool_t ChangeDirectory(const char *path) override;
129  const char *WorkingDirectory() override;
130  std::string GetWorkingDirectory() const override;
131  const char *HomeDirectory(const char *userName = nullptr) override;
132  std::string GetHomeDirectory(const char *userName = nullptr) const override;
133  const char *TempDirectory() const override;
134  FILE *TempFileName(TString &base, const char *dir = nullptr) override;
135 
136  //---- Paths & Files ----------------------------------------
137  const char *PrependPathName(const char *dir, TString& name) override;
138  Bool_t ExpandPathName(TString &patbuf) override;
139  char *ExpandPathName(const char *path) override;
140  Bool_t AccessPathName(const char *path, EAccessMode mode = kFileExists) override;
141  Bool_t IsPathLocal(const char *path) override;
142  int CopyFile(const char *from, const char *to, Bool_t overwrite = kFALSE) override;
143  int Rename(const char *from, const char *to) override;
144  int Link(const char *from, const char *to) override;
145  int Symlink(const char *from, const char *to) override;
146  int Unlink(const char *name) override;
147  int GetPathInfo(const char *path, FileStat_t &buf) override;
148  int GetFsInfo(const char *path, Long_t *id, Long_t *bsize,
149  Long_t *blocks, Long_t *bfree) override;
150  int Chmod(const char *file, UInt_t mode) override;
151  int Umask(Int_t mask) override;
152  int Utime(const char *file, Long_t modtime, Long_t actime) override;
153  const char *FindFile(const char *search, TString& file, EAccessMode mode = kFileExists) override;
154 
155  //---- Users & Groups ---------------------------------------
156  Int_t GetUid(const char *user = nullptr) override;
157  Int_t GetGid(const char *group = nullptr) override;
158  Int_t GetEffectiveUid() override;
159  Int_t GetEffectiveGid() override;
160  UserGroup_t *GetUserInfo(Int_t uid) override;
161  UserGroup_t *GetUserInfo(const char *user = nullptr) override;
162  UserGroup_t *GetGroupInfo(Int_t gid) override;
163  UserGroup_t *GetGroupInfo(const char *group = nullptr) override;
164 
165  //---- Environment Manipulation -----------------------------
166  const char *Getenv(const char *name) override;
167  void Setenv(const char *name, const char *value) override;
168  void Unsetenv(const char *name) override;
169 
170  //---- System Logging ---------------------------------------
171  void Openlog(const char *name, Int_t options, ELogFacility facility) override;
172  void Syslog(ELogLevel level, const char *mess) override;
173  void Closelog() override;
174 
175  //---- Standard Output redirection --------------------------
176  Int_t RedirectOutput(const char *name, const char *mode = "a",
177  RedirectHandle_t *h = nullptr) override;
178 
179  //---- Dynamic Loading --------------------------------------
180  void AddDynamicPath(const char *lib) override;
181  const char *GetDynamicPath() override;
182  void SetDynamicPath(const char *lib) override;
183  const char *FindDynamicLibrary(TString &lib, Bool_t quiet = kFALSE) override;
184  Func_t DynFindSymbol(const char *module, const char *entry) override;
185  int Load(const char *module, const char *entry = "", Bool_t system = kFALSE) override;
186  void Unload(const char *module) override;
187  void ListSymbols(const char *module, const char *re = "") override;
188  void ListLibraries(const char *regexp = "") override;
189 
190  //---- RPC --------------------------------------------------
191  TInetAddress GetHostByName(const char *server) override;
192  TInetAddress GetPeerName(int sock) override;
193  TInetAddress GetSockName(int sock) override;
194  int GetServiceByName(const char *service) override;
195  char *GetServiceByPort(int port) override;
196  int ConnectService(const char *server, int port, int tcpwindowsize, const char *protocol = "tcp");
197  int OpenConnection(const char *server, int port, int tcpwindowsize = -1, const char *protocol = "tcp") override;
198  int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize = -1) override;
199  int AnnounceUdpService(int port, int backlog) override;
200  int AnnounceUnixService(int port, int backlog) override;
201  int AnnounceUnixService(const char *sockpath, int backlog) override;
202  int AcceptConnection(int sock) override;
203  void CloseConnection(int sock, Bool_t force = kFALSE) override;
204  int RecvRaw(int sock, void *buffer, int length, int flag) override;
205  int SendRaw(int sock, const void *buffer, int length, int flag) override;
206  int RecvBuf(int sock, void *buffer, int length) override;
207  int SendBuf(int sock, const void *buffer, int length) override;
208  int SetSockOpt(int sock, int option, int val) override;
209  int GetSockOpt(int sock, int option, int *val) override;
210 
211  //---- System, CPU and Memory info
212  int GetSysInfo(SysInfo_t *info) const override;
213  int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime = 1000) const override;
214  int GetMemInfo(MemInfo_t *info) const override;
215  int GetProcInfo(ProcInfo_t *info) const override;
216 
217  ClassDefOverride(TUnixSystem,0) //Interface to Unix OS services
218 };
219 
220 #endif
TUnixSystem::Init
Bool_t Init() override
Initialize Unix system interface.
Definition: TUnixSystem.cxx:583
TUnixSystem::Syslog
void Syslog(ELogLevel level, const char *mess) override
Send mess to syslog daemon.
Definition: TUnixSystem.cxx:2617
TUnixSystem::ChangeDirectory
Bool_t ChangeDirectory(const char *path) override
Change directory. Returns kTRUE in case of success, kFALSE otherwise.
Definition: TUnixSystem.cxx:1402
TUnixSystem::SetDisplay
void SetDisplay() override
Set DISPLAY environment variable based on utmp entry. Only for UNIX.
Definition: TUnixSystem.cxx:651
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TUnixSystem::AccessPathName
Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists) override
Returns FALSE if one can access a file using the specified access mode.
Definition: TUnixSystem.cxx:1542
TUnixSystem::UnixRecv
static int UnixRecv(int sock, void *buf, int len, int flag)
Receive exactly length bytes into buffer.
Definition: TUnixSystem.cxx:4489
TUnixSystem::AcceptConnection
int AcceptConnection(int sock) override
Accept a connection.
Definition: TUnixSystem.cxx:3251
TUnixSystem::FindDynamicLibrary
const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE) override
Returns the path of a shared library (searches for library in the shared library search path).
Definition: TUnixSystem.cxx:4695
TUnixSystem::HostName
const char * HostName() override
Return the system's host name.
Definition: TUnixSystem.cxx:730
TUnixSystem::GetGid
Int_t GetGid(const char *group=nullptr) override
Returns the group's id. If group = 0, returns current user's group.
Definition: TUnixSystem.cxx:1992
TUnixSystem::RemoveSignalHandler
TSignalHandler * RemoveSignalHandler(TSignalHandler *sh) override
Remove a signal handler from list of signal handlers.
Definition: TUnixSystem.cxx:817
TUnixSystem::GetLinkedLibraries
const char * GetLinkedLibraries() override
Get list of shared libraries loaded at the start of the executable.
Definition: TUnixSystem.cxx:2820
ProcInfo_t
Definition: TSystem.h:192
TUnixSystem::AddFileHandler
void AddFileHandler(TFileHandler *fh) override
Add a file handler to the list of system file handlers.
Definition: TUnixSystem.cxx:750
TUnixSystem::WorkingDirectory
const char * WorkingDirectory() override
Return working directory.
Definition: TUnixSystem.cxx:1413
TUnixSystem::MakeDirectory
int MakeDirectory(const char *name) override
Make a Unix file system directory.
Definition: TUnixSystem.cxx:1348
TUnixSystem::UnixNow
static Long64_t UnixNow()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TUnixSystem.cxx:3828
TSignalHandler
Definition: TSysEvtHandler.h:127
TUnixSystem::StackTrace
void StackTrace() override
Print a stack trace.
Definition: TUnixSystem.cxx:2244
FileStat_t
Definition: TSystem.h:124
TUnixSystem::SendRaw
int SendRaw(int sock, const void *buffer, int length, int flag) override
Send exactly length bytes from buffer.
Definition: TUnixSystem.cxx:3380
TUnixSystem::UnixFilestat
static int UnixFilestat(const char *path, FileStat_t &buf)
Get info about a file.
Definition: TUnixSystem.cxx:4020
TUnixSystem::Unlink
int Unlink(const char *name) override
Unlink, i.e.
Definition: TUnixSystem.cxx:1671
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TUnixSystem::GetSysInfo
int GetSysInfo(SysInfo_t *info) const override
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
Definition: TUnixSystem.cxx:5192
TUnixSystem::ExpandPathName
Bool_t ExpandPathName(TString &patbuf) override
Expand a pathname getting rid of special shell characters like ~.
Definition: TUnixSystem.cxx:1712
TUnixSystem::Openlog
void Openlog(const char *name, Int_t options, ELogFacility facility) override
Open connection to system log daemon.
Definition: TUnixSystem.cxx:2579
TUnixSystem::GetHostByName
TInetAddress GetHostByName(const char *server) override
Get Internet Protocol (IP) address of host.
Definition: TUnixSystem.cxx:3009
TUnixSystem::IgnoreSignal
void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE) override
If ignore is true ignore the specified signal, else restore previous behaviour.
Definition: TUnixSystem.cxx:863
TUnixSystem::Unload
void Unload(const char *module) override
Unload a shared library.
Definition: TUnixSystem.cxx:2795
TUnixSystem::UnixSigAlarmInterruptsSyscalls
static void UnixSigAlarmInterruptsSyscalls(Bool_t set)
When the argument is true the SIGALRM signal handler is set so that interrupted syscalls will not be ...
Definition: TUnixSystem.cxx:3758
TUnixSystem::FillWithCwd
void FillWithCwd(char *cwd) const
Fill buffer with current working directory.
Definition: TUnixSystem.cxx:1441
TUnixSystem::ConnectService
int ConnectService(const char *server, int port, int tcpwindowsize, const char *protocol="tcp")
Connect to service servicename on server servername.
Definition: TUnixSystem.cxx:3176
TUnixSystem::UnixHomedirectory
static const char * UnixHomedirectory(const char *user=nullptr)
Returns the user's home directory.
Definition: TUnixSystem.cxx:3916
TUnixSystem::SetSockOpt
int SetSockOpt(int sock, int option, int val) override
Set socket option.
Definition: TUnixSystem.cxx:3412
TUnixSystem::ListSymbols
void ListSymbols(const char *module, const char *re="") override
List symbols in a shared library.
Definition: TUnixSystem.cxx:2803
TSystem
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:266
TUnixSystem::GetFsInfo
int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree) override
Get info about a file system: id, bsize, bfree, blocks.
Definition: TUnixSystem.cxx:1639
TUnixSystem::UnixResetSignal
static void UnixResetSignal(ESignals sig)
Restore old signal handler for specified signal.
Definition: TUnixSystem.cxx:3802
TUnixSystem::~TUnixSystem
virtual ~TUnixSystem()
Reset to original state.
Definition: TUnixSystem.cxx:569
TUnixSystem::Utime
int Utime(const char *file, Long_t modtime, Long_t actime) override
Set a files modification and access times.
Definition: TUnixSystem.cxx:1873
TUnixSystem::Setenv
void Setenv(const char *name, const char *value) override
Set environment variable.
Definition: TUnixSystem.cxx:2092
TUnixSystem::SetDynamicPath
void SetDynamicPath(const char *lib) override
Set the dynamic path to a new value.
Definition: TUnixSystem.cxx:4682
TUnixSystem::GetEffectiveUid
Int_t GetEffectiveUid() override
Returns the effective user id.
Definition: TUnixSystem.cxx:1984
TUnixSystem::RemoveFileHandler
TFileHandler * RemoveFileHandler(TFileHandler *fh) override
Remove a file handler from the list of file handlers.
Definition: TUnixSystem.cxx:772
TUnixSystem::AddDynamicPath
void AddDynamicPath(const char *lib) override
Add a new directory to the dynamic path.
Definition: TUnixSystem.cxx:4659
ESignals
ESignals
Definition: TSysEvtHandler.h:107
TTimer.h
TUnixSystem::UnixSend
static int UnixSend(int sock, const void *buf, int len, int flag)
Send exactly length bytes from buffer.
Definition: TUnixSystem.cxx:4539
TUnixSystem::SetFPEMask
Int_t SetFPEMask(Int_t mask=kDefaultMask) override
Set which conditions trigger a floating point exception.
Definition: TUnixSystem.cxx:967
TUnixSystem::GetDirEntry
const char * GetDirEntry(void *dirp) override
Get next Unix file system directory entry. Returns 0 if no more entries.
Definition: TUnixSystem.cxx:1387
ELogLevel
ELogLevel
Definition: TSystem.h:55
TUnixSystem::RemoveTimer
TTimer * RemoveTimer(TTimer *ti) override
Remove timer from list of system timers.
Definition: TUnixSystem.cxx:2981
TString
Basic string class.
Definition: TString.h:136
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
TUnixSystem::UnixSelect
static 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 timeou...
Definition: TUnixSystem.cxx:3882
TUnixSystem::Abort
void Abort(int code=0) override
Abort the application.
Definition: TUnixSystem.cxx:2165
TUnixSystem::UnixResetSignals
static void UnixResetSignals()
Restore old signal handlers.
Definition: TUnixSystem.cxx:3817
TUnixSystem::CloseConnection
void CloseConnection(int sock, Bool_t force=kFALSE) override
Close socket.
Definition: TUnixSystem.cxx:3273
TUnixSystem::Chmod
int Chmod(const char *file, UInt_t mode) override
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
Definition: TUnixSystem.cxx:1856
TUnixSystem::Select
Int_t Select(TList *active, Long_t timeout) override
Select on file descriptors.
Definition: TUnixSystem.cxx:1170
bool
TUnixSystem::Sleep
void Sleep(UInt_t milliSec) override
Sleep milliSec milliseconds.
Definition: TUnixSystem.cxx:1152
RedirectHandle_t
Definition: TSystem.h:203
TUnixSystem::IsPathLocal
Bool_t IsPathLocal(const char *path) override
Returns TRUE if the url in 'path' points to the local file system.
Definition: TUnixSystem.cxx:1606
TUnixSystem
Definition: TUnixSystem.h:32
TUnixSystem::Unsetenv
void Unsetenv(const char *name) override
Unset environment variable.
Definition: TUnixSystem.cxx:2108
TUnixSystem::ClosePipe
int ClosePipe(FILE *pipe) override
Close the pipe.
Definition: TUnixSystem.cxx:2134
TUnixSystem::Link
int Link(const char *from, const char *to) override
Create a link from file1 to file2.
Definition: TUnixSystem.cxx:1649
TUnixSystem::GetPathInfo
int GetPathInfo(const char *path, FileStat_t &buf) override
Get info about a file.
Definition: TUnixSystem.cxx:1621
group
Definition: TWinNTSystem.h:59
TUnixSystem::UnixSetitimer
static int UnixSetitimer(Long_t ms)
Set interval timer to time-out in ms milliseconds.
Definition: TUnixSystem.cxx:3856
TUnixSystem::HomeDirectory
const char * HomeDirectory(const char *userName=nullptr) override
Return the user's home directory.
Definition: TUnixSystem.cxx:1451
TUnixSystem::RecvRaw
int RecvRaw(int sock, void *buffer, int length, int flag) override
Receive exactly length bytes into buffer.
Definition: TUnixSystem.cxx:3343
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TUnixSystem::OpenDirectory
void * OpenDirectory(const char *name) override
Open a Unix file system directory. Returns 0 if directory does not exist.
Definition: TUnixSystem.cxx:1360
TUnixSystem::ListLibraries
void ListLibraries(const char *regexp="") override
List all loaded shared libraries.
Definition: TUnixSystem.cxx:2811
TUnixSystem::TempDirectory
const char * TempDirectory() const override
Return a user configured or systemwide directory to create temporary files in.
Definition: TUnixSystem.cxx:1471
TUnixSystem::Umask
int Umask(Int_t mask) override
Set the process file creation mode mask.
Definition: TUnixSystem.cxx:1864
TUnixSystem::FreeDirectory
void FreeDirectory(void *dirp) override
Close a Unix file system directory.
Definition: TUnixSystem.cxx:1372
TUnixSystem::UnixUnixService
static int UnixUnixService(int port, int backlog)
Open a socket, bind to it and start listening for Unix domain connections to it.
Definition: TUnixSystem.cxx:4413
SysInfo_t
Definition: TSystem.h:150
TSystem.h
TUnixSystem::ResetTimer
void ResetTimer(TTimer *ti) override
Reset a-sync timer.
Definition: TUnixSystem.cxx:2996
h
#define h(i)
Definition: RSha256.hxx:106
TUnixSystem::UnixSignal
static void UnixSignal(ESignals sig, SigHandler_t h)
Set a signal handler for a signal.
Definition: TUnixSystem.cxx:3684
TUnixSystem::GetProcInfo
int GetProcInfo(ProcInfo_t *info) const override
Returns cpu and memory used by this process into the ProcInfo_t structure.
Definition: TUnixSystem.cxx:5250
TUnixSystem::DynFindSymbol
Func_t DynFindSymbol(const char *module, const char *entry) override
dynamic linking of module
Definition: TUnixSystem.cxx:2777
TUnixSystem::ResetSignals
void ResetSignals() override
Reset signals handlers to previous behaviour.
Definition: TUnixSystem.cxx:854
TUnixSystem::UnixMakedir
static int UnixMakedir(const char *name)
Make a Unix file system directory.
Definition: TUnixSystem.cxx:3957
TUnixSystem::UnixUdpService
static int UnixUdpService(int port, int backlog)
Open a socket, bind to it and start listening for UDP connections on the port.
Definition: TUnixSystem.cxx:4354
SigHandler_t
void(* SigHandler_t)(ESignals)
Definition: TUnixSystem.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TUnixSystem::RedirectOutput
Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr) override
Redirect standard output (stdout, stderr) to the specified file.
Definition: TUnixSystem.cxx:2645
TUnixSystem::Load
int Load(const char *module, const char *entry="", Bool_t system=kFALSE) override
Load a shared library.
Definition: TUnixSystem.cxx:2787
MemInfo_t
Definition: TSystem.h:179
TUnixSystem::RecvBuf
int RecvBuf(int sock, void *buffer, int length) override
Receive a buffer headed by a length indicator.
Definition: TUnixSystem.cxx:3291
TUnixSystem::Now
TTime Now() override
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TUnixSystem.cxx:2933
TUnixSystem::CheckDescriptors
Bool_t CheckDescriptors()
Check if there is activity on some file descriptors and call their Notify() member.
Definition: TUnixSystem.cxx:1305
TUnixSystem::UnixTcpService
static 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.
Definition: TUnixSystem.cxx:4278
Long_t
long Long_t
Definition: RtypesCore.h:54
TUnixSystem::SetProgname
void SetProgname(const char *name) override
Set the application name (from command line, argv[0]) and copy it in gProgName.
Definition: TUnixSystem.cxx:629
TUnixSystem::UnixWaitchild
static int UnixWaitchild()
Wait till child is finished.
Definition: TUnixSystem.cxx:4111
TTime
Basic time type with millisecond precision.
Definition: TTime.h:27
TUnixSystem::GetGroupInfo
UserGroup_t * GetGroupInfo(Int_t gid) override
Returns all group info in the UserGroup_t structure.
Definition: TUnixSystem.cxx:2062
TUnixSystem::GetServiceByPort
char * GetServiceByPort(int port) override
Get name of internet service.
Definition: TUnixSystem.cxx:3161
ELogFacility
ELogFacility
Definition: TSystem.h:66
TUnixSystem::UnixFSstat
static 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.
Definition: TUnixSystem.cxx:4064
TUnixSystem::Symlink
int Symlink(const char *from, const char *to) override
Create a symlink from file1 to file2.
Definition: TUnixSystem.cxx:1658
TUnixSystem::OpenPipe
FILE * OpenPipe(const char *shellcmd, const char *mode) override
Open a pipe.
Definition: TUnixSystem.cxx:2126
TUnixSystem::CheckChilds
void CheckChilds()
Check if children have finished.
Definition: TUnixSystem.cxx:1285
extract_docstrings.module
module
Definition: extract_docstrings.py:39
TUnixSystem::TUnixSystem
TUnixSystem()
Definition: TUnixSystem.cxx:563
TUnixSystem::GetPeerName
TInetAddress GetPeerName(int sock) override
Get Internet Protocol (IP) address of remote host and port #.
Definition: TUnixSystem.cxx:3110
TUnixSystem::PrependPathName
const char * PrependPathName(const char *dir, TString &name) override
Concatenate a directory and a file name.
Definition: TUnixSystem.cxx:1515
TUnixSystem::UnixOpendir
static void * UnixOpendir(const char *name)
Open a directory.
Definition: TUnixSystem.cxx:3965
TUnixSystem::Closelog
void Closelog() override
Close connection to system log daemon.
Definition: TUnixSystem.cxx:2626
TUnixSystem::GetEffectiveGid
Int_t GetEffectiveGid() override
Returns the effective group id.
Definition: TUnixSystem.cxx:2008
TUnixSystem::GetCpuInfo
int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const override
Returns cpu load average and load info into the CpuInfo_t structure.
Definition: TUnixSystem.cxx:5216
TUnixSystem::GetPid
int GetPid() override
Get process id.
Definition: TUnixSystem.cxx:2142
void
typedef void((*Func_t)())
TUnixSystem::GetUserInfo
UserGroup_t * GetUserInfo(Int_t uid) override
Returns all user info in the UserGroup_t structure.
Definition: TUnixSystem.cxx:2017
TUnixSystem::FindFile
const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists) override
Find location of file "wfil" in a search path.
Definition: TUnixSystem.cxx:1890
TUnixSystem::AddTimer
void AddTimer(TTimer *ti) override
Add timer to list of system timers.
Definition: TUnixSystem.cxx:2972
unsigned int
TUnixSystem::DispatchOneEvent
void DispatchOneEvent(Bool_t pendingOnly=kFALSE) override
Dispatch a single event.
Definition: TUnixSystem.cxx:1061
TUnixSystem::UnixSigname
static const char * UnixSigname(ESignals sig)
Return the signal name associated with a signal.
Definition: TUnixSystem.cxx:3794
TUnixSystem::UnixIgnoreSignal
static void UnixIgnoreSignal(ESignals sig, Bool_t ignore)
If ignore is true ignore the specified signal, else restore previous behaviour.
Definition: TUnixSystem.cxx:3723
EAccessMode
EAccessMode
Definition: TSystem.h:43
TUnixSystem::AddSignalHandler
void AddSignalHandler(TSignalHandler *sh) override
Add a signal handler to list of system signal handlers.
Definition: TUnixSystem.cxx:805
TUnixSystem::Rename
int Rename(const char *from, const char *to) override
Rename a file. Returns 0 when successful, -1 in case of failure.
Definition: TUnixSystem.cxx:1595
TUnixSystem::OpenConnection
int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp") override
Open a connection to a service on a server.
Definition: TUnixSystem.cxx:3200
TUnixSystem::SendBuf
int SendBuf(int sock, const void *buffer, int length) override
Send a buffer headed by a length indicator.
Definition: TUnixSystem.cxx:3316
TUnixSystem::GetSockName
TInetAddress GetSockName(int sock) override
Get Internet Protocol (IP) address of host and port #.
Definition: TUnixSystem.cxx:3074
TUnixSystem::UnixUnixConnect
static int UnixUnixConnect(int port)
Connect to a Unix domain socket.
Definition: TUnixSystem.cxx:4222
file
Definition: file.py:1
TUnixSystem::DispatchSignals
void DispatchSignals(ESignals sig)
Handle and dispatch signals.
Definition: TUnixSystem.cxx:3629
TUnixSystem::UnixGetdirentry
static const char * UnixGetdirentry(void *dir)
Returns the next directory entry.
Definition: TUnixSystem.cxx:3991
kFileExists
@ kFileExists
Definition: TSystem.h:44
TUnixSystem::GetServiceByName
int GetServiceByName(const char *service) override
Get port # of internet service.
Definition: TUnixSystem.cxx:3146
UserGroup_t
Definition: TSystem.h:138
TUnixSystem::Exit
void Exit(int code, Bool_t mode=kTRUE) override
Exit the application.
Definition: TUnixSystem.cxx:2150
name
char name[80]
Definition: TGX11.cxx:110
TUnixSystem::TempFileName
FILE * TempFileName(TString &base, const char *dir=nullptr) override
Create a secure temporary file by appending a unique 6 letter string to base.
Definition: TUnixSystem.cxx:1489
TFileHandler
Definition: TSysEvtHandler.h:65
TUnixSystem::GetHomeDirectory
std::string GetHomeDirectory(const char *userName=nullptr) const override
Return the user's home directory.
Definition: TUnixSystem.cxx:1459
TUnixSystem::CheckSignals
Bool_t CheckSignals(Bool_t sync)
Check if some signals were raised and call their Notify() member.
Definition: TUnixSystem.cxx:1254
TUnixSystem::AnnounceUnixService
int AnnounceUnixService(int port, int backlog) override
Announce unix domain service on path "kServerPath/<port>".
Definition: TUnixSystem.cxx:3233
CpuInfo_t
Definition: TSystem.h:165
TUnixSystem::Exec
Int_t Exec(const char *shellcmd) override
Execute a command.
Definition: TUnixSystem.cxx:2118
TUnixSystem::CopyFile
int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE) override
Copy a file.
Definition: TUnixSystem.cxx:1561
TGeant4Unit::ms
static constexpr double ms
Definition: TGeant4SystemOfUnits.h:163
TUnixSystem::GetError
const char * GetError() override
Return system error string.
Definition: TUnixSystem.cxx:711
TUnixSystem::GetUid
Int_t GetUid(const char *user=nullptr) override
Returns the user's id. If user = 0, returns current user's id.
Definition: TUnixSystem.cxx:1968
TUnixSystem::GetDynamicPath
const char * GetDynamicPath() override
Return the dynamic path (used to find shared libraries).
Definition: TUnixSystem.cxx:4672
TUnixSystem::ResetSignal
void ResetSignal(ESignals sig, Bool_t reset=kTRUE) override
If reset is true reset the signal handler for the specified signal to the default handler,...
Definition: TUnixSystem.cxx:843
TUnixSystem::Getenv
const char * Getenv(const char *name) override
Get environment variable.
Definition: TUnixSystem.cxx:2100
TInetAddress
This class represents an Internet Protocol (IP) address.
Definition: TInetAddress.h:36
TUnixSystem::AnnounceUdpService
int AnnounceUdpService(int port, int backlog) override
Announce UDP service.
Definition: TUnixSystem.cxx:3225
TUnixSystem::GetFPEMask
Int_t GetFPEMask() override
Return the bitmap of conditions that trigger a floating point exception.
Definition: TUnixSystem.cxx:884
TUnixSystem::GetWorkingDirectory
std::string GetWorkingDirectory() const override
Return working directory.
Definition: TUnixSystem.cxx:1431
TUnixSystem::SigAlarmInterruptsSyscalls
void SigAlarmInterruptsSyscalls(Bool_t set) override
When the argument is true the SIGALRM signal handler is set so that interrupted syscalls will not be ...
Definition: TUnixSystem.cxx:876
TUnixSystem::GetSockOpt
int GetSockOpt(int sock, int option, int *val) override
Get socket option.
Definition: TUnixSystem.cxx:3482
TUnixSystem::GetMemInfo
int GetMemInfo(MemInfo_t *info) const override
Returns ram and swap memory usage info into the MemInfo_t structure.
Definition: TUnixSystem.cxx:5233
TUnixSystem::UnixUdpConnect
static int UnixUdpConnect(const char *hostname, int port)
Creates a UDP socket connection Is called via the TSocket constructor.
Definition: TUnixSystem.cxx:4178
TList
A doubly linked list.
Definition: TList.h:44
TUnixSystem::UnixTcpConnect
static int UnixTcpConnect(const char *hostname, int port, int tcpwindowsize)
Open a TCP/IP connection to server and connect to a service (i.e.
Definition: TUnixSystem.cxx:4126
TUnixSystem::AnnounceTcpService
int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1) override
Announce TCP/IP service.
Definition: TUnixSystem.cxx:3216
int
TUnixSystem::DispatchTimers
Bool_t DispatchTimers(Bool_t mode)
Handle and dispatch timers.
Definition: TUnixSystem.cxx:2942
kDefaultMask
@ kDefaultMask
Definition: TSystem.h:84
TSysEvtHandler.h