| 211 | } |
| 212 | |
| 213 | static StatusCode |
| 214 | parseCorePsinfo(const NoteData& note_data, CorePsInfo* result) |
| 215 | { |
| 216 | if (note_data.data->d_size != sizeof(CorePsInfo)) { |
| 217 | LOG(ERROR) << "Invalid psinfo note found"; |
| 218 | return StatusCode::ERROR; |
| 219 | } |
| 220 | std::memcpy(result, note_data.data->d_buf, sizeof(CorePsInfo)); |
| 221 | // Ensure that the char arrays are null terminated |
| 222 | result->fname[FNAME_SIZE - 1] = '\0'; |
| 223 | result->psargs[PSARGS_SIZE - 1] = '\0'; |
| 224 | return StatusCode::SUCCESS; |
| 225 | } |
| 226 | |
| 227 | static StatusCode |
| 228 | parseCorePrstatus(const NoteData& note_data, CoreCrashInfo* result) |