#include <errno.h>
#include <string>
#include "unistd.h"
#include "libgen.h"
#include <cstdio>
#include <sstream>
#include <iostream>
#include <fcntl.h>
#include "sys/times.h"
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/syscall.h>
#include <sys/procfs.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "ProcessDescriptor.h"
#include "GaudiKernel/ModuleInfo.h"
#include "GaudiKernel/System.h"
Go to the source code of this file.
|
| namespace | System |
| | Note: OS specific details for environment resolution.
|
| |
|
| enum | System::ProcessInfoCommand {
System::ProcessBasicInformation,
System::ProcessQuotaLimits,
System::ProcessIoCounters,
System::ProcessVmCounters,
System::ProcessTimes,
System::ProcessBasePriority,
System::ProcessRaisePriority,
System::ProcessDebugPort,
System::ProcessExceptionPort,
System::ProcessAccessToken,
System::ProcessLdtInformation,
System::ProcessLdtSize,
System::ProcessDefaultHardErrorMode,
System::ProcessIoPortHandlers,
System::ProcessPooledUsageAndLimits,
System::ProcessWorkingSetWatch,
System::ProcessUserModeIOPL,
System::ProcessEnableAlignmentFaultFixup,
System::ProcessPriorityClass,
System::ProcessWx86Information,
System::ProcessHandleCount,
System::ProcessAffinityMask,
System::ProcessPriorityBoost,
System::MaxProcessInfoClass,
System::ProcessEllapsedTime
} |
| |
| #define GAUDIKERNEL_PROCSTAT_CPP |
| #define s_myPid (::getpid()) |
| static long processID |
( |
long |
pid | ) |
|
|
inlinestatic |
| void readProcStat |
( |
long |
pid, |
|
|
linux_proc & |
pinfo |
|
) |
| |
Definition at line 303 of file ProcessDescriptor.cpp.
{
int cnt, fd;
char buf[512];
ost << "/proc/" << pid << "/stat";
if((fd=open(fname.c_str(),O_RDONLY))<0) {
return;
}
lseek(fd,0,SEEK_SET);
if((cnt=read(fd,buf,sizeof(buf)))<0) {
close(fd);
return;
}
if(cnt>0) {
buf[cnt]='\0';
sscanf(buf,
"%d %s %c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %llu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu",
);
}
close(fd);
}
| long pg_size = sysconf(_SC_PAGESIZE) |
|
static |
| const long TICK_TO_100NSEC = 100000 |
|
static |