69#if defined (_MSC_VER) && (_MSC_VER >= 1400)
71#elif defined (_M_IX86)
129 ::SysError(
"TFdSet::Set",
"fd_count will exeed FD_SETSIZE");
134 for (i=0; i<
fds_bits->fd_count; i++) {
169 static struct signal_map {
175 SIGSEGV, 0,
"segmentation violation",
176 -1 , 0,
"bad argument to system call",
177 -1 , 0,
"write on a pipe with no one to read it",
178 SIGILL, 0,
"illegal instruction",
182 -1 , 0,
"window size change",
183 -1 , 0,
"alarm clock",
184 -1 , 0,
"death of a child",
185 -1 , 0,
"urgent data arrived on an I/O channel",
186 SIGFPE, 0,
"floating point exception",
187 SIGTERM, 0,
"termination signal",
188 -1 , 0,
"user-defined signal 1",
189 -1 , 0,
"user-defined signal 2"
212 if (
socket == -1)
return -1;
225 char *buf = (
char *)buffer;
243 ::SysError(
"TWinNTSystem::WinNTRecv",
"recv");
266 if (
socket < 0)
return -1;
276 const char *buf = (
const char *)buffer;
287 ::SysError(
"TWinNTSystem::WinNTSend",
"send");
399 if (signal_map[i].code == sig) {
400 (*signal_map[i].handler)((
ESignals)i);
411 signal_map[sig].handler = handler;
412 if (signal_map[sig].code != -1)
421 return signal_map[sig].signame;
435 Break(
"TInterruptHandler::Notify",
"keyboard interrupt");
446 printf(
"\n *** Break *** keyboard interrupt - ROOT is terminated\n");
474#pragma intrinsic(_ReturnAddress)
475#pragma auto_inline(off)
481#pragma auto_inline(on)
506 endLoop = (*gGUIThreadMsgFunc)(&
msg);
514 Error(
"MsgLoop",
"Error in GetMessage");
620 std::ostringstream
out;
628 out <<
line.FileName <<
"(" <<
line.LineNumber <<
"): ";
632 module.SizeOfStruct = sizeof(module);
634 out <<
module.ModuleName << "!";
636 out <<
"0x" << std::hex << address << std::dec <<
" ";
643 std::string GetFunctionName(
DWORD64 address)
691 const char *
extLnk =
".lnk";
772 if (
strcmp(sys->TWinNTSystem::BaseName(buf),
"root.exe"))
844 static const char apptitle[] =
"ROOT data file";
869 cmd +=
" -l \"%1\" \"";
883 static const char appname[] =
"ROOTDEV.ROOT";
898 static bool once =
true;
901 if (!
once ||
gROOT->IsBatch())
return false;
906 if (i == 0 && ((arg !=
"root") && (arg !=
"rootn") &&
907 (arg !=
"root.exe") && (arg !=
"rootn.exe")))
return false;
908 else if ((arg ==
"-l") || (arg ==
"-b"))
return false;
993 Error(
"TWinNTSystem()",
"Starting sockets failed");
1135 std::this_thread::sleep_for(std::chrono::duration<double, std::nano>(10));
1171 Error(
"BaseName",
"name = 0");
1184 Error(
"BaseName",
"name = 0");
1195 char *
dot =
nullptr;
1197 char *fullname =
nullptr;
1201 if (
name && namelen > 0) {
1203 fullname =
new char[namelen+5];
1205 if ( !
strrchr(fullname,
'.') )
1206 strlcat(fullname,
".exe",namelen+5);
1212 char *
which =
nullptr;
1262 error_msg.Form(
"errno out of range %d", err);
1276 return !res ?
len : -1;
1289 DWORD
il =
sizeof(
hn);
1339 int fd =
h->GetFd();
1342 if (
h->HasReadInterest()) {
1345 if (
h->HasWriteInterest()) {
1357 if (!
h)
return nullptr;
1401 if (!
h)
return nullptr;
1466 std::cerr <<
"No stack trace: cannot find (functions in) dbghelp.dll!" << std::endl;
1474 switch (
sysInfo.wProcessorArchitecture) {
1492 std::cerr << std::endl <<
"==========================================" << std::endl;
1493 std::cerr <<
"=============== STACKTRACE ===============" << std::endl;
1494 std::cerr <<
"==========================================" << std::endl << std::endl;
1530 frame.AddrPC.Offset = context.Eip;
1531 frame.AddrFrame.Offset = context.Ebp;
1532 frame.AddrStack.Offset = context.Esp;
1533#elif defined(_M_X64)
1534 frame.AddrPC.Offset = context.Rip;
1535 frame.AddrFrame.Offset = context.Rsp;
1536 frame.AddrStack.Offset = context.Rsp;
1537#elif defined(_M_IA64)
1538 frame.AddrPC.Offset = context.StIIP;
1539 frame.AddrFrame.Offset = context.IntSp;
1540 frame.AddrStack.Offset = context.IntSp;
1541 frame.AddrBStore.Offset= context.RsBSP;
1543 std::cerr <<
"Stack traces not supported on your architecture yet." << std::endl;
1552 std::cerr << std::endl <<
"================ Thread " <<
iThread++ <<
" ================" << std::endl;
1555 const std::string
functionName = GetFunctionName(frame.AddrPC.Offset);
1563 std::cerr << std::endl <<
"==========================================" << std::endl;
1564 std::cerr <<
"============= END STACKTRACE =============" << std::endl;
1565 std::cerr <<
"==========================================" << std::endl << std::endl;
1629 if (
gROOT->GetApplication()) {
1733 if (
rc < 0 &&
rc != -2) {
1734 ::SysError(
"DispatchOneEvent",
"select: read error on %d\n", fd);
1747 if (
rc < 0 &&
rc != -2) {
1748 ::SysError(
"DispatchOneEvent",
"select: write error on %d\n", fd);
1845 (
fddone == fd && read)) {
1855 (
fddone == fd && !read)) {
1899 if (res)
return res;
1922 if (!
name)
return 0;
1926 if (!
name)
return 0;
1968 if (
tsfd->fFirstFile) {
1973 return (
const char *)
tsfd->fFindFileData.cFileName;
1976 return (
const char *)
tsfd->fFindFileData.cFileName;
2020#pragma data_seg(".text", "CODE")
2065 return helper->OpenDirectory(fdir);
2068 const char *
proto = (
strstr(fdir,
"file:///")) ?
"file://" :
"file:";
2194 Warning(
"WorkingDirectory",
"getcwd() failed");
2218 return std::string(
mydir);
2226 const char *
h =
nullptr;
2248 if (
mydir[1] ==
':')
2287 ::SysError(
"TempFileName",
"Fail to generate temporary file name");
2296 ::SysError(
"TempFileName",
"Temporary file %s already exists", base.
Data());
2303 ::SysError(
"TempFileName",
"Fail to rename temporary file to %s", base.
Data());
2311 if (!fp)
::SysError(
"TempFileName",
"error opening %s", base.
Data());
2329 if (!opt || !opt[0]) {
2339 if (
strstr(opt,
"cur")) {
2368 else if (
strstr(opt,
"all")) {
2491 (*(
lpchar+1) ==
'\\' || *(
lpchar+1) ==
'/') )
return 0;
2505 return (
dir[idx] ==
'/' ||
dir[idx] ==
'\\');
2568 const char *
proto = (
strstr(path,
"file:///")) ?
"file://" :
"file:";
2588 return helper->IsPathLocal(path);
2602 if (last !=
'/' && last !=
'\\') {
2606 name.ReplaceAll(
"/",
"\\");
2623 if (!
ret)
return -1;
2647 return helper->GetPathInfo(path, buf);
2652 const char *
proto = (
strstr(path,
"file:///")) ?
"file://" :
"file:";
2733 const char *
fsNames[] = {
"FAT",
"NTFS" };
2735 for (i = 0; i < 2; i++) {
2912 return ::_rmdir(
name);
2914 return ::_unlink(
name);
2944 char *cmd =
nullptr;
2949 if (
patbuf0.BeginsWith(
"\\")) {
2959 if (!
proto.EqualTo(
"file"))
2963 if (
patbuf0.BeginsWith(
"file:"))
3033 cmd =
new char[
lbuf+1];
3075 return ::_chmod(file,
mode);
3083 return ::umask(
mask);
3093 Error(
"Utime",
"need write permission for %s to change utime", file);
3099 t.actime = (time_t)
actime;
3100 t.modtime = (time_t)modtime;
3101 return ::utime(file, &t);
3129 for(
int i=0; i <
exsearch.Length(); ++i) {
3165 if ((
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) && (::GetVersion() < 0x80000000)) {
3200 DWORD Index = 0,
Total = 0;
3260 DWORD Index = 0,
Total = 0, i;
3279 for (i=0; i <
Total; i++) {
3322 unsigned char j = 0;
3389 DWORD Index = 0,
Total = 0, i;
3444 for (i=0; i <
Total; i++) {
3498 putenv ((GetVersion () & 0x80000000) ?
"SHELL=command" :
"SHELL=cmd");
3523 DWORD Index = 0,
Total = 0, i;
3541 for (i=0; i <
Total; i++) {
3581 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3596 if (!user || !user[0])
3622 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3649 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3690 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3718 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3726 ug->fGroup =
"administrators";
3730 ug->fGroup =
"users";
3732 ug->fGid =
ug->fUid;
3735 ug->fUser =
"unknown";
3736 ug->fGroup =
"unknown";
3737 ug->fUid =
ug->fGid = 123;
3740 ug->fRealName =
ug->fUser;
3741 ug->fShell =
"command";
3748 for (
int i = 0; i <
fNbUsers; i++) {
3757 ug->fUid =
pwd->pw_uid;
3758 ug->fGid =
pwd->pw_gid;
3759 ug->fUser =
pwd->pw_name;
3760 ug->fPasswd =
pwd->pw_passwd;
3761 ug->fRealName =
pwd->pw_gecos;
3762 ug->fShell =
pwd->pw_shell;
3763 ug->fGroup =
pwd->pw_group;
3792 if ((!
gEnv->
GetValue(
"WinNT.UseNetAPI", 0)) || (::GetVersion() >= 0x80000000)) {
3798 gr->fGroup =
"administrators";
3802 gr->fGroup =
"users";
3807 gr->fGroup =
"unknown";
3815 if (gid ==
fGroups[i].gr_gid) {
3823 gr->fGid =
grp->gr_gid;
3824 gr->fGroup =
grp->gr_name;
3891 return ::_pclose(
pipe);
3919 gROOT->CloseFiles();
3920 if (
gROOT->GetListOfBrowsers()) {
3923 if (
gROOT->IsBatch())
3924 gROOT->GetListOfBrowsers()->Delete();
3929 if (
b->GetBrowserImp() &&
b->GetBrowserImp()->GetMainFrame())
3931 (((TBrowser*)0x%zx)->GetBrowserImp()->GetMainFrame()->CloseWindow();",
3984 const char *
m = (
mode[0] ==
'a' ||
mode[0] ==
'w') ?
mode :
"a";
3987 xh->fReadOffSet = 0;
3992 xh->fReadOffSet = (
st.fSize > 0) ?
st.fSize :
xh->fReadOffSet;
4001 SysError(
"RedirectOutput",
"could not freopen stdout");
4015 SysError(
"RedirectOutput",
"could not freopen stderr");
4041 SysError(
"RedirectOutput",
"could not restore stdout");
4055 SysError(
"RedirectOutput",
"could not restore stderr");
4129 Error(
"DynamicPathName",
4130 "%s does not exist in %s,\nor has wrong file extension (.dll)",
4147#pragma warning(push)
4148#pragma warning(disable:4200)
4220 switch((
unsigned short)
pheader->signature) {
4235#define isin(address,start,length) ((address)>=(start) && (address)<(start)+(length))
4261 if (
dll.EndsWith(
".dll")) {
4319 libs.ReplaceAll(
"/",
"\\");
4328 std::string::size_type first, last;
4331 if (str.rfind(
"-L", 0) == 0) {
4332 first = str.find_first_of(
'%');
4333 last = str.find_last_of(
'%');
4334 if ((first != std::string::npos) && (last != std::string::npos) &&
4339 std::string var = str.substr(first+1, last-first-1);
4344 env += str.substr(last+1);
4349 ntlibs.Append(str.c_str());
4354 last = str.rfind(
".dll");
4355 if (last != std::string::npos)
4356 str.replace(last, 4,
".lib");
4357 last = str.rfind(
".DLL");
4358 if (last != std::string::npos)
4359 str.replace(last, 4,
".lib");
4360 if (str.rfind(
".lib") != std::string::npos ||
4361 str.rfind(
".LIB") != std::string::npos) {
4363 if (
_stat( str.c_str(), &buf ) == 0) {
4365 ntlibs.Append(str.c_str());
4387 if (str.find(
windir) == std::string::npos) {
4404 ntlibs.Append(lib.c_str());
4433 if (!
ti)
return nullptr;
4535 ::Error(
"GetCPUTime",
" Error on GetProcessTimes 0x%lx", (
int)
ret);
4555 static time_t
jan95 = 0;
4567 if ((
int)
jan95 == -1) {
4568 ::SysError(
"TWinNTSystem::Now",
"error converting 950001 0:00 to time_t");
4585 std::this_thread::sleep_for(std::chrono::milliseconds(
milliSec));
4601 if (
h->HasReadInterest())
4603 if (
h->HasWriteInterest())
4605 h->ResetReadyMask();
4636 if (
h->HasReadInterest())
4638 if (
h->HasWriteInterest())
4640 h->ResetReadyMask();
4664 Error(
"GetServiceByName",
"no service \"%s\" with protocol \"%s\"\n",
4668 return ::ntohs(
sp->s_port);
4680 return Form(
"%d", port);
4703 for (i = 1;
host_ptr->h_addr_list[i]; i++) {
4707 for (i = 0;
host_ptr->h_aliases[i]; i++)
4711 host =
"UnNamedHost";
4716 Error(
"GetHostByName",
"%s is not an internet host\n",
hostname);
4725 for (i = 1;
host_ptr->h_addr_list[i]; i++) {
4729 for (i = 0;
host_ptr->h_aliases[i]; i++)
4815 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket");
4828 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"bind");
4834 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"listen");
4847 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket path undefined");
4859 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"socket");
4870 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"bind");
4875 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"getsockname");
4882 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"fopen");
4890 ::SysError(
"TWinNTSystem::AnnounceUnixService",
"listen");
4902 if (
socket == -1)
return;
4924 if (
WinNTRecv(sock, &header,
sizeof(header), 0) > 0) {
4928 Error(
"RecvBuf",
"record header exceeds buffer size");
4930 }
else if (count > 0) {
4931 if (
WinNTRecv(sock, buf, count, 0) < 0) {
4932 Error(
"RecvBuf",
"cannot receive buffer");
4949 if (
WinNTSend(sock, &header,
sizeof(header), 0) < 0) {
4950 Error(
"SendBuf",
"cannot send header");
4955 Error(
"SendBuf",
"cannot send buffer");
4997 Error(
"RecvRaw",
"cannot receive buffer");
5033 Error(
"SendRaw",
"cannot send buffer");
5046 if (
socket == -1)
return -1;
5052 ::SysError(
"SetSockOpt",
"setsockopt(SO_SNDBUF)");
5058 ::SysError(
"SetSockOpt",
"setsockopt(SO_RCVBUF)");
5064 SysError(
"SetSockOpt",
"setsockopt(SO_OOBINLINE)");
5070 ::SysError(
"SetSockOpt",
"setsockopt(SO_KEEPALIVE)");
5076 ::SysError(
"SetSockOpt",
"setsockopt(SO_REUSEADDR)");
5082 ::SysError(
"SetSockOpt",
"setsockopt(TCP_NODELAY)");
5095 ::SysError(
"SetSockOpt",
"ioctl(SIOCSPGRP)");
5103 Error(
"SetSockOpt",
"illegal option (%d)", opt);
5115 if (
socket == -1)
return -1;
5118 int optlen =
sizeof(*val);
5123 ::SysError(
"GetSockOpt",
"getsockopt(SO_SNDBUF)");
5129 ::SysError(
"GetSockOpt",
"getsockopt(SO_RCVBUF)");
5135 ::SysError(
"GetSockOpt",
"getsockopt(SO_OOBINLINE)");
5141 ::SysError(
"GetSockOpt",
"getsockopt(SO_KEEPALIVE)");
5147 ::SysError(
"GetSockOpt",
"getsockopt(SO_REUSEADDR)");
5153 ::SysError(
"GetSockOpt",
"getsockopt(TCP_NODELAY)");
5170 ::SysError(
"GetSockOpt",
"ioctl(SIOCGPGRP)");
5177 ::SysError(
"GetSockOpt",
"ioctl(SIOCATMARK)");
5188 Error(
"GetSockOpt",
"illegal option (%d)", opt);
5213 if (!
strcmp(protocol,
"udp")){
5224 if (!
addr.IsValid())
return -1;
5236 ::SysError(
"TWinNTSystem::WinNTConnectTcp",
"socket");
5268 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"socket");
5276 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"connect");
5293 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"socket path undefined");
5300 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"fopen");
5307 ::SysError(
"TWinNTSystem::WinNTUnixConnect",
"invalid port");
5328 if (!
addr.IsValid())
return -1;
5340 ::SysError(
"TWinNTSystem::WinNTUdpConnect",
"socket (%s:%d)",
5349 ::SysError(
"TWinNTSystem::WinNTUdpConnect",
"connect (%s:%d)",
5367 const char *protocol)
5399 if (port == 0 &&
reuse) {
5400 ::Error(
"TWinNTSystem::WinNTTcpService",
"cannot do a port scan while reuse is true");
5413 ::SysError(
"TWinNTSystem::WinNTTcpService",
"socket");
5435 ::SysError(
"TWinNTSystem::WinNTTcpService",
"bind");
5447 ::SysError(
"TWinNTSystem::WinNTTcpService",
"bind (port scan)");
5454 ::SysError(
"TWinNTSystem::WinNTTcpService",
"listen");
5485 ::SysError(
"TUnixSystem::UnixUdpService",
"socket");
5498 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"bind");
5510 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"bind (port scan)");
5517 ::SysError(
"TWinNTSystem::AnnounceUdpService",
"listen");
5554#define SystemBasicInformation 0
5555#define SystemPerformanceInformation 2
5595#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + (double)((x).LowPart))
5628#define SM_SERVERR2 89
5664 "GetNativeSystemInfo");
5669 switch (
osvi.dwPlatformId)
5675 if (
osvi.dwMajorVersion == 6 &&
osvi.dwMinorVersion == 0 )
5681 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 2 )
5692 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 1 )
5695 if (
osvi.dwMajorVersion == 5 &&
osvi.dwMinorVersion == 0 )
5698 if (
osvi.dwMajorVersion <= 4 )
5708 if(
osvi.dwMajorVersion == 4 )
5718 if(
osvi.dwMajorVersion==5 &&
osvi.dwMinorVersion==2)
5746 else if(
osvi.dwMajorVersion==5 &&
osvi.dwMinorVersion==0)
5771 "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
5795 if(
osvi.dwMajorVersion == 4 &&
5803 "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009",
5806 snprintf(temp, 512,
"Service Pack 6a (Build %d)",
osvi.dwBuildNumber & 0xFFFF );
5811 snprintf(temp,512,
"%s (Build %d)",
osvi.szCSDVersion,
osvi.dwBuildNumber & 0xFFFF);
5819 snprintf(temp, 512,
"%s (Build %d)",
osvi.szCSDVersion,
osvi.dwBuildNumber & 0xFFFF);
5828 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 0)
5831 if (
osvi.szCSDVersion[1]==
'C' ||
osvi.szCSDVersion[1]==
'B')
5835 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 10)
5838 if (
osvi.szCSDVersion[1]==
'A' ||
osvi.szCSDVersion[1]==
'B')
5842 if (
osvi.dwMajorVersion == 4 &&
osvi.dwMinorVersion == 90)
5868 return (((
unsigned)
nBuff[2])>>16);
5894 "Error on GetProcAddress(NtQuerySystemInformation)");
5906 ::Error(
"GetWinNTSysInfo",
"Error on GlobalMemoryStatusEx()");
5928 "Hardware\\Description\\System\\CentralProcessor\\0",
5975 ::Error(
"GetWinNTCpuInfo",
"Error on LoadLibrary(Kernel32.dll)");
5982 ::Error(
"GetWinNTCpuInfo",
"Error on GetProcAddress(GetSystemTimes)");
6047 ::Error(
"GetWinNTMemInfo",
"Error on GlobalMemoryStatusEx()");
6083 ::Error(
"GetWinNTProcInfo",
"Error on LoadLibrary(Psapi.dll)");
6091 "Error on GetProcAddress(GetProcessMemoryInfo)");
6096 procinfo->fMemResident =
pmc.WorkingSetSize / 1024;
6127 if (!
info)
return -1;
6139 if (!
info)
return -1;
6150 if (!
info)
return -1;
6161 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()
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