void dmtcp::ProcessInfo::init() { #ifdef CONFIG_M32 _elfType = Elf_32; #else _elfType = Elf_64; #endif growStack(); // Reserve space for restoreBuf _restoreBufLen = RESTORE_TOTAL_SIZE; // Allocate two extra pages -- one at the start, one at the end -- to work as // guard pages for the restore area. void *addr = mmap(NULL, _restoreBufLen + (2 * 4096), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); JASSERT(addr != MAP_FAILED) (JASSERT_ERRNO); _restoreBufAddr = (uint64_t) addr + 4096; JASSERT(mprotect((void*)_restoreBufAddr, _restoreBufLen, PROT_NONE) == 0) ((void*)_restoreBufAddr) (_restoreBufLen) (JASSERT_ERRNO); if (_ckptDir.empty()) { updateCkptDirFileSubdir(); } }
int testExpandStack_cmd(int argc, char **argv) { log(L_INFO, "Expanding stack... Current ESP is 0x%x", _ESP); growStack(); log(L_INFO, "Stack expanded... Current ESP is 0x%x", _ESP); printf("Stack expanded...\n"); return 0; }