| 151 | } |
| 152 | |
| 153 | ProcessInfo::ProcessInfo() |
| 154 | { |
| 155 | char buf[PATH_MAX]; |
| 156 | |
| 157 | _do_lock_tbl(); |
| 158 | |
| 159 | strcpy(ckptSignature, DMTCP_CKPT_SIGNATURE); |
| 160 | memset(padding, 0, sizeof(padding)); |
| 161 | |
| 162 | upid = UniquePid::ThisProcess(); |
| 163 | uppid = UniquePid::ParentProcess(); |
| 164 | |
| 165 | restoreBuf.startAddr = 0; |
| 166 | restoreBuf.endAddr = 0; |
| 167 | |
| 168 | pid = -1; |
| 169 | ppid = -1; |
| 170 | sid = -1; |
| 171 | gid = -1; |
| 172 | fgid = -1; |
| 173 | isRootOfProcessTree = false; |
| 174 | numPeers = 1; |
| 175 | |
| 176 | #ifdef CONFIG_M32 |
| 177 | _elfType = Elf_32; |
| 178 | #else // ifdef CONFIG_M32 |
| 179 | elfType = Elf_64; |
| 180 | #endif // ifdef CONFIG_M32 |
| 181 | |
| 182 | clock_gettime_offset = dmtcp_dlsym_lib_fnc_offset("linux-vdso", |
| 183 | "__vdso_clock_gettime"); |
| 184 | getcpu_offset = dmtcp_dlsym_lib_fnc_offset("linux-vdso", |
| 185 | "__vdso_getcpu"); |
| 186 | gettimeofday_offset = dmtcp_dlsym_lib_fnc_offset("linux-vdso", |
| 187 | "__vdso_gettimeofday"); |
| 188 | time_offset = dmtcp_dlsym_lib_fnc_offset("linux-vdso", "__vdso_time"); |
| 189 | |
| 190 | vdso = {0, 0}; |
| 191 | vvar = {0, 0}; |
| 192 | vvarVClock = {0, 0}; |
| 193 | endOfStack = 0; |
| 194 | savedBrk = (uint64_t) sbrk(0); |
| 195 | endOfStack = 0; |
| 196 | postRestartAddr = 0; |
| 197 | |
| 198 | string procSelfExeStr = jalib::Filesystem::ResolveSymlink("/proc/self/exe"); |
| 199 | strncpy(procSelfExe, procSelfExeStr.c_str(), sizeof(procSelfExe) - 1); |
| 200 | |
| 201 | _generation = 0; |
| 202 | |
| 203 | // _generation, above, is per-process. |
| 204 | // This contrasts with DmtcpUniqueProcessId:_computation_generation, which is |
| 205 | // shared among all process on a node; used in variable sharedDataHeader. |
| 206 | // _generation is updated when _this_ process begins its checkpoint. |
| 207 | _pthreadJoinId.clear(); |
| 208 | JASSERT(getcwd(buf, sizeof buf) != NULL); |
| 209 | _launchCWD = buf; |
| 210 | _do_unlock_tbl(); |
nothing calls this directly
no test coverage detected