70#if defined (_MSC_VER) && (_MSC_VER >= 1400)
72#elif defined (_M_IX86)
130 ::SysError(
"TFdSet::Set",
"fd_count will exeed FD_SETSIZE");
135 for (i=0; i<
fds_bits->fd_count; i++) {
170 static struct signal_map {
176 SIGSEGV, 0,
"segmentation violation",
177 -1 , 0,
"bad argument to system call",
178 -1 , 0,
"write on a pipe with no one to read it",
179 SIGILL, 0,
"illegal instruction",
183 -1 , 0,
"window size change",
184 -1 , 0,
"alarm clock",
185 -1 , 0,
"death of a child",
186 -1 , 0,
"urgent data arrived on an I/O channel",
187 SIGFPE, 0,
"floating point exception",
188 SIGTERM, 0,
"termination signal",
189 -1 , 0,
"user-defined signal 1",
190 -1 , 0,
"user-defined signal 2"
213 if (
socket == -1)
return -1;
226 char *buf = (
char *)buffer;
244 ::SysError(
"TWinNTSystem::WinNTRecv",
"recv");
267 if (
socket < 0)
return -1;
277 const char *buf = (
const char *)buffer;
288 ::SysError(
"TWinNTSystem::WinNTSend",
"send");
400 if (signal_map[i].code == sig) {
401 (*signal_map[i].handler)((
ESignals)i);
412 signal_map[sig].handler = handler;
413 if (signal_map[sig].code != -1)
422 return signal_map[sig].signame;
436 Break(
"TInterruptHandler::Notify",
"keyboard interrupt");
447 printf(
"\n *** Break *** keyboard interrupt - ROOT is terminated\n");
475#pragma intrinsic(_ReturnAddress)
476#pragma auto_inline(off)
482#pragma auto_inline(on)
507 endLoop = (*gGUIThreadMsgFunc)(&
msg);
515 Error(
"MsgLoop",
"Error in GetMessage");
633 module.SizeOfStruct = sizeof(module);
644 std::string GetFunctionName(
DWORD64 address)
692 const char *
extLnk =
".lnk";
773 if (
strcmp(sys->TWinNTSystem::BaseName(buf),
"root.exe"))
845 static const char apptitle[] =
"ROOT data file";
870 cmd +=
" -l \"%1\" \"";
884 static const char appname[] =
"ROOTDEV.ROOT";
899 static bool once =
true;
902 if (!
once ||
gROOT->IsBatch())
return false;
904 Int_t i = 0, from = 0;
905 while (
cmdline.Tokenize(arg, from,
" ")) {
907 if (i == 0 && ((arg !=
"root") && (arg !=
"rootn") &&
908 (arg !=
"root.exe") && (arg !=
"rootn.exe")))
return false;
909 else if ((arg ==
"-l") || (arg ==
"-b"))
return false;
994 Error(
"TWinNTSystem()",
"Starting sockets failed");
1136 std::this_thread::sleep_for(std::chrono::duration<double, std::nano>(10));
1172 Error(
"BaseName",
"name = 0");
1185 Error(
"BaseName",
"name = 0");
1196 char *dot =
nullptr;
1198 char *fullname =
nullptr;
1202 if (
name && namelen > 0) {
1204 fullname =
new char[namelen+5];
1206 if ( !
strrchr(fullname,
'.') )
1207 strlcat(fullname,
".exe",namelen+5);
1213 char *
which =
nullptr;
1263 error_msg.Form(
"errno out of range %d", err);
1277 return !res ?
len : -1;
1290 DWORD
il =
sizeof(
hn);
1340 int fd =
h->GetFd();
1343 if (
h->HasReadInterest()) {
1346 if (
h->HasWriteInterest()) {
1358 if (!
h)
return nullptr;
1402 if (!
h)
return nullptr;
1467 std::cerr <<
"No stack trace: cannot find (functions in) dbghelp.dll!" << std::endl;
1475 switch (
sysInfo.wProcessorArchitecture) {
1493 std::cerr << std::endl <<
"==========================================" << std::endl;
1494 std::cerr <<
"=============== STACKTRACE ===============" << std::endl;
1495 std::cerr <<
"==========================================" << std::endl << std::endl;
1531 frame.AddrPC.Offset = context.Eip;
1532 frame.AddrFrame.Offset = context.Ebp;
1533 frame.AddrStack.Offset = context.Esp;
1534#elif defined(_M_X64)
1535 frame.AddrPC.Offset = context.Rip;
1536 frame.AddrFrame.Offset = context.Rsp;
1537 frame.AddrStack.Offset = context.Rsp;
1538#elif defined(_M_IA64)
1539 frame.AddrPC.Offset = context.StIIP;
1540 frame.AddrFrame.Offset = context.IntSp;
1541 frame.AddrStack.Offset = context.IntSp;
1542 frame.AddrBStore.Offset= context.RsBSP;
1544 std::cerr <<
"Stack traces not supported on your architecture yet." << std::endl;
1553 std::cerr << std::endl <<
"================ Thread " <<
iThread++ <<
" ================" << std::endl;
1556 const std::string
functionName = GetFunctionName(frame.AddrPC.Offset);
1564 std::cerr << std::endl <<
"==========================================" << std::endl;
1565 std::cerr <<
"============= END STACKTRACE =============" << std::endl;
1566 std::cerr <<
"==========================================" << std::endl << std::endl;
1630 if (
gROOT->GetApplication()) {
1734 if (
rc < 0 &&
rc != -2) {
1735 ::SysError(
"DispatchOneEvent",
"select: read error on %d\n", fd);
1748 if (
rc < 0 &&
rc != -2) {
1749 ::SysError(
"DispatchOneEvent",
"select: write error on %d\n", fd);
1846 (
fddone == fd && read)) {
1856 (
fddone == fd && !read)) {
1900 if (res)
return res;
1923 if (!
name)
return 0;
1927 if (!
name)
return 0;
1969 if (
tsfd->fFirstFile) {
1974 return (
const char *)
tsfd->fFindFileData.cFileName;
1977 return (
const char *)
tsfd->fFindFileData.cFileName;
2021#pragma data_seg(".text", "CODE")
2066 return helper->OpenDirectory(fdir);
2069 const char *
proto = (
strstr(fdir,
"file:///")) ?
"file://" :
"file:";
2195 Warning(
"WorkingDirectory",
"getcwd() failed");
2219 return std::string(
mydir);
2227 const char *
h =
nullptr;
2249 if (
mydir[1] ==
':')
2266 if (!dir) dir =
"c:\\";
2288 ::SysError(
"TempFileName",
"Fail to generate temporary file name");
2297 ::SysError(
"TempFileName",
"Temporary file %s already exists", base.
Data());
2304 ::SysError(
"TempFileName",
"Fail to rename temporary file to %s", base.
Data());
2312 if (!fp)
::SysError(
"TempFileName",
"error opening %s", base.
Data());
2330 if (!opt || !opt[0]) {
2340 if (
strstr(opt,
"cur")) {
2369 else if (
strstr(opt,
"all")) {
2492 (*(
lpchar+1) ==
'\\' || *(
lpchar+1) ==
'/') )
return 0;
2505 if (
strchr(dir,
':')) idx = 2;
2506 return (dir[idx] ==
'/' || dir[idx] ==
'\\');
2569 const char *
proto = (
strstr(path,
"file:///")) ?
"file://" :
"file:";
2589 return helper->IsPathLocal(path);
2600 if (dir && dir[0]) {
2602 char last = dir[
strlen(dir) - 1];
2603 if (last !=
'/' && last !=
'\\') {
2607 name.ReplaceAll(
"/",
"\\");
2624 if (!
ret)
return -1;
2633 int ret = std::rename(
f, t);
2648 return helper->GetPathInfo(path, buf);
2653 const char *
proto = (
strstr(path,
"file:///")) ?
"file://" :
"file:";
2734 const char *
fsNames[] = {
"FAT",
"NTFS" };
2736 for (i = 0; i < 2; i++) {
2839 if ((from ==
NULL) || (!from[0]) || (to ==
NULL) ||
2913 return ::_rmdir(
name);
2915 return ::_unlink(
name);
2945 char *
cmd =
nullptr;
2956 if (
patbuf0.BeginsWith(
"\\")) {
2966 if (!
proto.EqualTo(
"file"))
2970 if (
patbuf0.BeginsWith(
"file:"))
3082 return ::_chmod(file,
mode);
3090 return ::umask(
mask);
3100 Error(
"Utime",
"need write permission for %s to change utime", file);
3106 t.actime = (time_t)
actime;
3107 t.modtime = (time_t)modtime;
3108 return ::utime(file, &t);
3136 for(
int i=0; i <
exsearch.Length(); ++i) {
3172 if ((
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) && (::GetVersion() < 0x80000000)) {
3207 DWORD Index = 0,
Total = 0;
3267 DWORD Index = 0,
Total = 0, i;
3286 for (i=0; i <
Total; i++) {
3329 unsigned char j = 0;
3396 DWORD Index = 0,
Total = 0, i;
3451 for (i=0; i <
Total; i++) {
3505 putenv ((GetVersion () & 0x80000000) ?
"SHELL=command" :
"SHELL=cmd");
3530 DWORD Index = 0,
Total = 0, i;
3548 for (i=0; i <
Total; i++) {
3588 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3603 if (!user || !user[0])
3629 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3656 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3697 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3725 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3733 ug->fGroup =
"administrators";
3737 ug->fGroup =
"users";
3739 ug->fGid =
ug->fUid;
3742 ug->fUser =
"unknown";
3743 ug->fGroup =
"unknown";
3744 ug->fUid =
ug->fGid = 123;
3747 ug->fRealName =
ug->fUser;
3748 ug->fShell =
"command";
3755 for (
int i = 0; i <
fNbUsers; i++) {
3764 ug->fUid =
pwd->pw_uid;
3765 ug->fGid =
pwd->pw_gid;
3766 ug->fUser =
pwd->pw_name;
3767 ug->fPasswd =
pwd->pw_passwd;
3768 ug->fRealName =
pwd->pw_gecos;
3769 ug->fShell =
pwd->pw_shell;
3770 ug->fGroup =
pwd->pw_group;
3799 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3805 gr->fGroup =
"administrators";
3809 gr->fGroup =
"users";
3814 gr->fGroup =
"unknown";
3822 if (gid ==
fGroups[i].gr_gid) {
3830 gr->fGid =
grp->gr_gid;
3831 gr->fGroup =
grp->gr_name;
3898 return ::_pclose(
pipe);
3926 gROOT->CloseFiles();
3927 if (
gROOT->GetListOfBrowsers()) {
3930 if (
gROOT->IsBatch())
3931 gROOT->GetListOfBrowsers()->Delete();
3936 if (
b->GetBrowserImp() &&
b->GetBrowserImp()->GetMainFrame())
3938 (((TBrowser*)0x%zx)->GetBrowserImp()->GetMainFrame()->CloseWindow();",
3991 const char *
m = (
mode[0] ==
'a' ||
mode[0] ==
'w') ?
mode :
"a";
3994 xh->fReadOffSet = 0;
3999 xh->fReadOffSet = (
st.fSize > 0) ?
st.fSize :
xh->fReadOffSet;
4008 SysError(
"RedirectOutput",
"could not freopen stdout");
4022 SysError(
"RedirectOutput",
"could not freopen stderr");
4048 SysError(
"RedirectOutput",
"could not restore stdout");
4062 SysError(
"RedirectOutput",
"could not restore stderr");
4136 Error(
"DynamicPathName",
4137 "%s does not exist in %s,\nor has wrong file extension (.dll)",
4154#pragma warning(push)
4155#pragma warning(disable:4200)
4227 switch((
unsigned short)
pheader->signature) {
4242#define isin(address,start,length) ((address)>=(start) && (address)<(start)+(length))
4268 if (
dll.EndsWith(
".dll")) {
4326 libs.ReplaceAll(
"/",
"\\");
4335 std::string::size_type first, last;
4338 if (str.rfind(
"-L", 0) == 0) {
4339 first = str.find_first_of(
'%');
4340 last = str.find_last_of(
'%');
4341 if ((first != std::string::npos) && (last != std::string::npos) &&
4346 std::string var = str.substr(first+1, last-first-1);
4351 env += str.substr(last+1);
4356 ntlibs.Append(str.c_str());
4361 last = str.rfind(
".dll");
4362 if (last != std::string::npos)
4363 str.replace(last, 4,
".lib");
4364 last = str.rfind(
".DLL");
4365 if (last != std::string::npos)
4366 str.replace(last, 4,
".lib");
4367 if (str.rfind(
".lib") != std::string::npos ||
4368 str.rfind(
".LIB") != std::string::npos) {
4370 if (
_stat( str.c_str(), &buf ) == 0) {
4372 ntlibs.Append(str.c_str());
4394 if (str.find(
windir) == std::string::npos) {
4411 ntlibs.Append(lib.c_str());
4440 if (!
ti)
return nullptr;
4542 ::Error(
"GetCPUTime",
" Error on GetProcessTimes 0x%lx", (
int)
ret);
4562 static time_t
jan95 = 0;
4574 if ((
int)
jan95 == -1) {
4575 ::SysError(
"TWinNTSystem::Now",
"error converting 950001 0:00 to time_t");
4592 std::this_thread::sleep_for(std::chrono::milliseconds(
milliSec));
4608 if (
h->HasReadInterest())
4610 if (
h->HasWriteInterest())
4612 h->ResetReadyMask();
4643 if (
h->HasReadInterest())
4645 if (
h->HasWriteInterest())
4647 h->ResetReadyMask();
4671 Error(
"GetServiceByName",
"no service \"%s\" with protocol \"%s\"\n",
4675 return ::ntohs(
sp->s_port);
4687 return Form(
"%d", port);
4710 for (i = 1;
host_ptr->h_addr_list[i]; i++) {
4714 for (i = 0;
host_ptr->h_aliases[i]; i++)
4718 host =
"UnNamedHost";
4723 Error(
"GetHostByName",
"%s is not an internet host\n",
hostname);
4732 for (i = 1;
host_ptr->h_addr_list[i]; i++) {
4736 for (i = 0;
host_ptr->h_aliases[i]; i++)
4822 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket");
4835 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"bind");
4841 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"listen");
4854 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket path undefined");
4866 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket");
4877 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"bind");
4882 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"getsockname");
4889 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"fopen");
4897 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"listen");
4909 if (
socket == -1)
return;
4931 if (
WinNTRecv(sock, &header,
sizeof(header), 0) > 0) {
4935 Error(
"RecvBuf",
"record header exceeds buffer size");
4937 }
else if (count > 0) {
4938 if (
WinNTRecv(sock, buf, count, 0) < 0) {
4939 Error(
"RecvBuf",
"cannot receive buffer");
4956 if (
WinNTSend(sock, &header,
sizeof(header), 0) < 0) {
4957 Error(
"SendBuf",
"cannot send header");
4962 Error(
"SendBuf",
"cannot send buffer");
5004 Error(
"RecvRaw",
"cannot receive buffer");
5040 Error(
"SendRaw",
"cannot send buffer");
5053 if (
socket == -1)
return -1;
5059 ::SysError(
"SetSockOpt",
"setsockopt(SO_SNDBUF)");
5065 ::SysError(
"SetSockOpt",
"setsockopt(SO_RCVBUF)");
5071 SysError(
"SetSockOpt",
"setsockopt(SO_OOBINLINE)");
5077 ::SysError(
"SetSockOpt",
"setsockopt(SO_KEEPALIVE)");
5083 ::SysError(
"SetSockOpt",
"setsockopt(SO_REUSEADDR)");
5089 ::SysError(
"SetSockOpt",
"setsockopt(TCP_NODELAY)");
5102 ::SysError(
"SetSockOpt",
"ioctl(SIOCSPGRP)");
5110 Error(
"SetSockOpt",
"illegal option (%d)", opt);
5122 if (
socket == -1)
return -1;
5125 int optlen =
sizeof(*val);
5130 ::SysError(
"GetSockOpt",
"getsockopt(SO_SNDBUF)");
5136 ::SysError(
"GetSockOpt",
"getsockopt(SO_RCVBUF)");
5142 ::SysError(
"GetSockOpt",
"getsockopt(SO_OOBINLINE)");
5148 ::SysError(
"GetSockOpt",
"getsockopt(SO_KEEPALIVE)");
5154 ::SysError(
"GetSockOpt",
"getsockopt(SO_REUSEADDR)");
5160 ::SysError(
"GetSockOpt",
"getsockopt(TCP_NODELAY)");
5177 ::SysError(
"GetSockOpt",
"ioctl(SIOCGPGRP)");
5184 ::SysError(
"GetSockOpt",
"ioctl(SIOCATMARK)");
5195 Error(
"GetSockOpt",
"illegal option (%d)", opt);
5220 if (!
strcmp(protocol,
"udp")){
5231 if (!
addr.IsValid())
return -1;
5243 ::SysError(
"TWinNTSystem::WinNTConnectTcp",
"socket");
5275 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"socket");
5283 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"connect");
5300 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"socket path undefined");
5307 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"fopen");
5314 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"invalid port");
5335 if (!
addr.IsValid())
return -1;
5347 ::SysError(
"TWinNTSystem::WinNTUdpConnect",
"socket (%s:%d)",
5356 ::SysError(
"TWinNTSystem::WinNTUdpConnect",
"connect (%s:%d)",
5374 const char *protocol)
5406 if (port == 0 &&
reuse) {
5407 ::Error(
"TWinNTSystem::WinNTTcpService",
"cannot do a port scan while reuse is true");
5420 ::SysError(
"TWinNTSystem::WinNTTcpService",
"socket");
5442 ::SysError(
"TWinNTSystem::WinNTTcpService",
"bind");
5454 ::SysError(
"TWinNTSystem::WinNTTcpService",
"bind (port scan)");
5461 ::SysError(
"TWinNTSystem::WinNTTcpService",
"listen");
5492 ::SysError(
"TUnixSystem::UnixUdpService",
"socket");
5505 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"bind");
5517 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"bind (port scan)");
5524 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"listen");
5561#define SystemBasicInformation 0
5562#define SystemPerformanceInformation 2
5602#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
5635#define SM_SERVERR2 89
5671 "GetNativeSystemInfo");
5676 switch (
osvi.dwPlatformId)
5682 if (
osvi.dwMajorVersion == 6 &&
osvi.dwMinorVersion == 0 )
5688 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 2 )
5699 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 1 )
5702 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 0 )
5705 if (
osvi.dwMajorVersion <= 4 )
5715 if(
osvi.dwMajorVersion == 4 )
5725 if(
osvi.dwMajorVersion==5 &&
osvi.dwMinorVersion==2)
5753 else if(
osvi.dwMajorVersion==5 &&
osvi.dwMinorVersion==0)
5778 "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
5802 if(
osvi.dwMajorVersion == 4 &&
5810 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009",
5813 snprintf(temp, 512,
"Service Pack 6a (Build %d)",
osvi.dwBuildNumber & 0xFFFF );
5818 snprintf(temp,512,
"%s (Build %d)",
osvi.szCSDVersion,
osvi.dwBuildNumber & 0xFFFF);
5826 snprintf(temp, 512,
"%s (Build %d)",
osvi.szCSDVersion,
osvi.dwBuildNumber & 0xFFFF);
5835 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 0)
5838 if (
osvi.szCSDVersion[1]==
'C' ||
osvi.szCSDVersion[1]==
'B')
5842 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 10)
5845 if (
osvi.szCSDVersion[1]==
'A' ||
osvi.szCSDVersion[1]==
'B')
5849 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 90)
5875 return (((
unsigned)
nBuff[2])>>16);
5901 "Error on GetProcAddress(NtQuerySystemInformation)");
5913 ::Error(
"GetWinNTSysInfo",
"Error on GlobalMemoryStatusEx()");
5935 "Hardware\\Description\\System\\CentralProcessor\\0",
5982 ::Error(
"GetWinNTCpuInfo",
"Error on LoadLibrary(Kernel32.dll)");
5989 ::Error(
"GetWinNTCpuInfo",
"Error on GetProcAddress(GetSystemTimes)");
6054 ::Error(
"GetWinNTMemInfo",
"Error on GlobalMemoryStatusEx()");
6090 ::Error(
"GetWinNTProcInfo",
"Error on LoadLibrary(Psapi.dll)");
6098 "Error on GetProcAddress(GetProcessMemoryInfo)");
6103 procinfo->fMemResident =
pmc.WorkingSetSize / 1024;
6134 if (!
info)
return -1;
6146 if (!
info)
return -1;
6157 if (!
info)
return -1;
6168 if (!
info)
return -1;
The file contains utilities which are foundational and could be used across the core component of ROO...
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void SysError(const char *location, const char *msgfmt,...)
Use this function in case a system (OS or GUI) related error occurred.
void Break(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Int_t gErrorIgnoreLevel
Error handling routines.
R__EXTERN TExceptionHandler * gExceptionHandler
R__EXTERN void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
static unsigned int total
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
#define INVALID_HANDLE_VALUE
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
char * StrDup(const char *str)
Duplicate the string str.
@ kSigSegmentationViolation
R__EXTERN const char * gProgName
R__EXTERN const char * gRootDir
ESocketBindOption
Options for binging the sockets created.
@ kInaddrAny
Any address for socket binding.
R__EXTERN TSystem * gSystem
R__EXTERN TFileHandler * gXDisplay
R__EXTERN const char * gProgPath
static void sighandler(int sig)
Call the signal handler associated with the signal.
static const char * DynamicPath(const char *newpath=nullptr, Bool_t reset=kFALSE)
Get shared library search path. Static utility function.
static void SigHandler(ESignals sig)
Unix signal handler.
const char * kProtocolName
void(* SigHandler_t)(ESignals)
R__EXTERN TWin32SplashThread * gSplash
static void __cpuid(int *cpuid_data, int)
static const char * shellMeta
BOOL PathIsRoot(LPCTSTR pPath)
check if a path is a root
static void GetWinNTProcInfo(ProcInfo_t *procinfo)
Get process info for this process on Windows NT.
static int GetL2CacheSize()
Use assembly to retrieve the L2 cache information ...
struct _PROCESS_MEMORY_COUNTERS * PPROCESS_MEMORY_COUNTERS
static void GetWinNTCpuInfo(CpuInfo_t *cpuinfo, Int_t sampleTime)
Get CPU stat for Window.
void Gl_setwidth(int width)
void(WINAPI * PGNSI)(LPSYSTEM_INFO)
#define SystemPerformanceInformation
ULongptr_t gConsoleWindow
BOOL PathIsUNC(LPCTSTR pszPath)
Returns TRUE if the given string is a UNC path.
static const char shellEscape
const TCHAR c_szColonSlash[]
static void GetWinNTMemInfo(MemInfo_t *meminfo)
Get VM stat for Windows NT.
static DWORD GetCPUSpeed()
Calculate the CPU clock speed using the 'rdtsc' instruction.
struct _PROCESS_MEMORY_COUNTERS PROCESS_MEMORY_COUNTERS
#define isin(address, start, length)
static const char * shellStuff
__inline BOOL DBL_BSLASH(LPCTSTR psz)
Inline function to check for a double-backslash at the beginning of a string.
static void GetWinNTSysInfo(SysInfo_t *sysinfo)
Get system info for Windows NT.
static const char * GetWindowsVersion()
void * _ReturnAddress(void)
LONG(WINAPI * PROCNTQSI)(UINT, PVOID, ULONG, PULONG)
virtual Bool_t HandleTermInput()
Using a TBrowser one can browse all ROOT objects.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual void HandleException(int sig)=0
ULong_t fds_bits[(((kFDSETSIZE)+((kNFDBITS) -1))/(kNFDBITS))]
TFdSet & operator=(const TFdSet &fd)
void Copy(TFdSet &fd) const
virtual Bool_t WriteNotify()
Notify when something can be written to the descriptor associated with this handler.
virtual Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
Bool_t Notify() override
Notify when event occurred on descriptor associated with this handler.
This class represents an Internet Protocol (IP) address.
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Iterator of ordered collection.
TObject * Next() override
Return next object in collection.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
static void ShutDown()
Shut down ROOT.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
Regular expression class.
Bool_t Notify() override
Notify when signal occurs.
ESignals GetSignal() const
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Abstract base class defining a generic interface to the underlying Operating System.
TSeqCollection * fFileHandler
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
TString & GetLastErrorString()
Return the thread local storage for the custom last error message.
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
static void ResetErrno()
Static function resetting system error number.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
static Int_t GetErrno()
Static function returning system error number.
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 SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual const char * Getenv(const char *env)
Get environment variable.
TFdSet * fWritemask
Files that should be checked for read events.
TFdSet * fSignals
Files with writes waiting.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual const char * ExpandFileName(const char *fname)
Expand a pathname getting rid of special shell characters like ~.
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
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.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void ExitLoop()
Exit from event loop.
virtual Bool_t Init()
Initialize the OS interface.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
TFdSet * fWriteready
Files with reads waiting.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
TSeqCollection * fSignalHandler
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
TFdSet * fReadready
Files that should be checked for write events.
TSystem * FindHelper(const char *path, void *dirptr=nullptr)
Create helper TSystem to handle file and directory operations that might be special for remote file a...
Int_t fNfd
Signals that were trapped.
std::atomic< Bool_t > fInsideNotify
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
static const char * StripOffProto(const char *path, const char *proto)
Strip off protocol string from specified path.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
virtual void StackTrace()
Print a stack trace.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
Basic time type with millisecond precision.
Handles synchronous and a-synchronous timer events.
Bool_t CheckTimer(const TTime &now)
Check if timer timed out.
This class represents a WWW compatible URL.
void CloseConnection(int sock, Bool_t force=kFALSE) override
Close socket.
TList * GetVolumes(Option_t *opt="") const override
Get list of volumes (drives) mounted on the system.
FILE * OpenPipe(const char *shellcmd, const char *mode) override
Open a pipe.
void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE) override
If ignore is true ignore the specified signal, else restore previous behaviour.
Bool_t HandleConsoleEvent()
int Utime(const char *file, Long_t modtime, Long_t actime) override
Set a files modification and access times.
void Sleep(UInt_t milliSec) override
Sleep milliSec milli seconds.
TTime Now() override
Get current time in milliseconds since 0:00 Jan 1 1995.
int AnnounceUdpService(int port, int backlog, ESocketBindOption socketBindOption=ESocketBindOption::kInaddrAny) override
Announce UDP service.
const char * HostName() override
Return the system's host name.
virtual ~TWinNTSystem()
dtor
FILE * TempFileName(TString &base, const char *dir=nullptr, const char *suffix=nullptr) override
Create a secure temporary file by appending a unique 6 letter string to base.
void ExitLoop() override
Exit from event loop.
int SetNonBlock(int fd)
Make descriptor fd non-blocking.
int AnnounceUnixService(int port, int backlog) override
Announce unix domain service.
const char * GetLinkedLibraries() override
Get list of shared libraries loaded at the start of the executable.
void AddSignalHandler(TSignalHandler *sh) override
Add a signal handler to list of system signal handlers.
const char * PrependPathName(const char *dir, TString &name) override
Concatenate a directory and a file name.
void SetGUIThreadMsgHandler(ThreadMsgFunc_t func)
Set the (static part of) the event handler func for GUI messages.
Bool_t ProcessEvents() override
process pending events, i.e. DispatchOneEvent(kTRUE)
const char DriveName(const char *pathname="/")
Return the drive letter in pathname.
int SetSockOpt(int sock, int opt, int val) override
Set socket option.
struct passwd * fPasswords
Int_t GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const override
Returns cpu load average and load info into the CpuInfo_t structure.
Int_t SetFPEMask(Int_t mask=kDefaultMask) override
Set which conditions trigger a floating point exception.
int GetPathInfo(const char *path, FileStat_t &buf) override
Get info about a file.
static void ThreadStub(void *Parameter)
void FreeDirectory(void *dirp) override
Close a WinNT file system directory.
static int WinNTUdpConnect(const char *hostname, int port)
Creates a UDP socket connection Is called via the TSocket constructor.
Int_t 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...
void * OpenDirectory(const char *name) override
Open a directory. Returns 0 if directory does not exist.
const char * Getenv(const char *name) override
Get environment variable.
UserGroup_t * GetGroupInfo(Int_t gid) override
Returns all group info in the UserGroup_t structure.
void AddTimer(TTimer *ti) override
Add timer to list of system timers.
int RecvBuf(int sock, void *buffer, int length) override
Receive a buffer headed by a length indicator.
void DoBeep(Int_t freq=-1, Int_t duration=-1) const override
Beep.
void TimerThread()
Special Thread to check asynchronous timers.
const char * GetDynamicPath() override
Return the dynamic path (used to find shared libraries).
Bool_t ExpandPathName(TString &patbuf) override
Expand a pathname getting rid of special shell characaters like ~.$, etc.
int GetServiceByName(const char *service) override
Get port # of internet service.
int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp") override
Open a connection to a service on a server.
int ConnectService(const char *servername, int port, int tcpwindowsize, const char *protocol="tcp")
Connect to service servicename on server servername.
TString GetDirName(const char *pathname) override
Return the directory name in pathname.
int SendRaw(int sock, const void *buffer, int length, int flag) override
Send exactly length bytes from buffer.
const char * TempDirectory() const override
Return a user configured or systemwide directory to create temporary files in.
void DispatchSignals(ESignals sig)
Handle and dispatch signals.
int Exec(const char *shellcmd) override
Execute a command.
Long_t LookupSID(const char *lpszAccountName, int what, int &groupIdx, int &memberIdx)
Take the name and look up a SID so that we can get full domain/user information.
Int_t GetEffectiveUid() override
Returns the effective user id.
void NotifyApplicationCreated() override
Hook to tell TSystem that the TApplication object has been created.
void Abort(int code=0) override
Abort the application.
Int_t Select(TList *active, Long_t timeout) override
Select on file descriptors. The timeout to is in millisec.
Int_t GetMemInfo(MemInfo_t *info) const override
Returns ram and swap memory usage info into the MemInfo_t structure.
Int_t GetProcInfo(ProcInfo_t *info) const override
Returns cpu and memory used by this process into the ProcInfo_t structure.
TFileHandler * RemoveFileHandler(TFileHandler *fh) override
Remove a file handler from the list of file handlers.
Bool_t DispatchTimers(Bool_t mode)
Handle and dispatch timers.
const char * DirName(const char *pathname) override
Return the directory name in pathname.
Bool_t IsPathLocal(const char *path) override
Returns TRUE if the url in 'path' points to the local file system.
int SendBuf(int sock, const void *buffer, int length) override
Send a buffer headed by a length indicator.
TInetAddress GetHostByName(const char *server) override
Get Internet Protocol (IP) address of host.
Bool_t ChangeDirectory(const char *path) override
Change directory.
int AcceptConnection(int sock) override
Accept a connection.
int GetPid() override
Get process id.
const char * WorkingDirectory() override
Return the working directory for the default drive.
void SetProgname(const char *name) override
Set the application name (from command line, argv[0]) and copy it in gProgName.
int GetSockOpt(int sock, int opt, int *val) override
Get socket option.
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.
int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1, ESocketBindOption socketBindOption=ESocketBindOption::kInaddrAny) override
Announce TCP/IP service.
int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE) override
Copy a file.
Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr) override
Redirect standard output (stdout, stderr) to the specified file.
Bool_t IsAbsoluteFileName(const char *dir) override
Return true if dir is an absolute pathname.
int mkdir(const char *name, Bool_t recursive=kFALSE) override
Make a file system directory.
const char * UnixPathName(const char *unixpathname) override
Convert a pathname to a unix pathname.
Bool_t CheckSignals(Bool_t sync)
Check if some signals were raised and call their Notify() member.
int Symlink(const char *from, const char *to) override
Create a symlink from file1 to file2.
void DispatchOneEvent(Bool_t pendingOnly=kFALSE) override
Dispatch a single event in TApplication::Run() loop.
int Load(const char *module, const char *entry="", Bool_t system=kFALSE) override
Load a shared library.
TSignalHandler * RemoveSignalHandler(TSignalHandler *sh) override
Remove a signal handler from list of signal handlers.
const char * GetError() override
Return system error string.
void StackTrace() override
Print a stack trace, if gEnv entry "Root.Stacktrace" is unset or 1, and if the image helper functions...
int Unlink(const char *name) override
Unlink, i.e.
void ResetSignals() override
Reset signals handlers to previous behaviour.
int RecvRaw(int sock, void *buffer, int length, int flag) override
Receive exactly length bytes into buffer.
const char * BaseName(const char *name) override
Base name of a file name.
TTimer * RemoveTimer(TTimer *ti) override
Remove timer from list of system timers.
void Exit(int code, Bool_t mode=kTRUE) override
Exit the application.
void AddDynamicPath(const char *dir) override
Add a new directory to the dynamic path.
int Umask(Int_t mask) override
Set the process file creation mode mask.
void AddFileHandler(TFileHandler *fh) override
Add a file handler to the list of system file handlers.
std::string fDirNameBuffer
Bool_t CheckDescriptors()
Check if there is activity on some file descriptors and call their Notify() member.
static int WinNTUnixConnect(int port)
Connect to a Unix domain socket.
int Chmod(const char *file, UInt_t mode) override
Set the file permission bits.
Bool_t Init() override
Initialize WinNT system interface.
const char * GetDirEntry(void *dirp) override
Returns the next directory entry.
TInetAddress GetSockName(int sock) override
Get Internet Protocol (IP) address of host and port #.
Bool_t(* ThreadMsgFunc_t)(MSG *)
TInetAddress GetPeerName(int sock) override
Get Internet Protocol (IP) address of remote host and port #.
Int_t GetUid(const char *user=nullptr) override
Returns the user's id. If user = 0, returns current user's id.
const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists) override
Find location of file in a search path.
const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE) override
Returns and updates sLib to the path of a dynamic library (searches for library in the dynamic librar...
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,...
Bool_t CollectMembers(const char *lpszGroupName, int &groupIdx, int &memberIdx)
Bool_t CountMembers(const char *lpszGroupName)
std::string GetHomeDirectory(const char *userName=nullptr) const override
Return the user's home directory.
Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists) override
Returns FALSE if one can access a file using the specified access mode.
void FillWithHomeDirectory(const char *userName, char *mydir) const
Fill buffer with user's home directory.
char * GetServiceByPort(int port) override
Get name of internet service.
Bool_t InitUsersGroups()
Collect local users and groups accounts information.
Int_t GetGid(const char *group=nullptr) override
Returns the group's id. If group = 0, returns current user's group.
const char * HomeDirectory(const char *userName=0) override
Return the user's home directory.
Int_t GetEffectiveGid() override
Returns the effective group id.
void Setenv(const char *name, const char *value) override
Set environment variable.
void SetDynamicPath(const char *path) override
Set the dynamic path to a new value.
std::string GetWorkingDirectory() const override
Return the working directory for the default drive.
HANDLE GetProcess()
Get current process handle.
UserGroup_t * GetUserInfo(Int_t uid) override
Returns all user info in the UserGroup_t structure.
int Rename(const char *from, const char *to) override
Rename a file. Returns 0 when successful, -1 in case of failure.
int MakeDirectory(const char *name) override
Make a WinNT file system directory.
int Link(const char *from, const char *to) override
Create a link from file1 to file2.
const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE) override
Return a space separated list of loaded shared libraries.
int ClosePipe(FILE *pipe) override
Close the pipe.
Int_t GetFPEMask() override
Return the bitmap of conditions that trigger a floating point exception.
Int_t GetCryptoRandom(void *buf, Int_t len) override
Return cryptographic random number Fill provided buffer with random values Returns number of bytes wr...
const std::string & GetFallbackRootSys()
R__EXTERN TROOT * gROOTLocal
Struct used to pass information between OpenDirectory and GetDirEntry in a thread safe way (each thre...
WIN32_FIND_DATA fFindFileData
SIZE_T QuotaNonPagedPoolUsage
SIZE_T PeakWorkingSetSize
SIZE_T QuotaPeakNonPagedPoolUsage
SIZE_T QuotaPeakPagedPoolUsage
SIZE_T QuotaPagedPoolUsage