MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / init

Method init

src/processinfo.cpp:310–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310void
311ProcessInfo::init()
312{
313 if (pid == -1) {
314 // This is a brand new process.
315 pid = getpid();
316 ppid = getppid();
317 isRootOfProcessTree = true;
318 uppid = UniquePid();
319
320 string procSelfExeStr = jalib::Filesystem::ResolveSymlink("/proc/self/exe");
321 strncpy(procSelfExe, procSelfExeStr.c_str(), sizeof(procSelfExe) - 1);
322 }
323
324#ifdef CONFIG_M32
325 _elfType = Elf_32;
326#else // ifdef CONFIG_M32
327 elfType = Elf_64;
328#endif // ifdef CONFIG_M32
329
330 vdso = {0, 0};
331 vvar = {0, 0};
332 vvarVClock = {0, 0};
333 endOfStack = 0;
334
335 processRlimit();
336
337 growStack();
338
339 _initialSavedBrk = (uint64_t)sbrk(0);
340 uint64_t brkMmap = (uint64_t)mmap(
341 (void *)_initialSavedBrk, EndOfBrkMapSize, PROT_NONE,
342 MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED, -1, 0);
343 ASSERT_EQ(brkMmap, _initialSavedBrk);
344
345 // Reserve space for restoreBuf
346 updateRestoreBufAddr();
347
348 if (_ckptDir.empty()) {
349 updateCkptDirFileSubdir();
350 }
351}
352
353void
354ProcessInfo::updateRestoreBufAddr()

Callers 1

processInfo_EventHookFunction · 0.45

Calls 4

getppidFunction · 0.85
UniquePidClass · 0.85
getpidFunction · 0.50
mmapFunction · 0.50

Tested by

no test coverage detected