#ifndef AC_LOG_MOUNT_H #define AC_LOG_MOUNT_H #include #include #include #include // Resolve the kernel's visible mount ID, not the first/last /mnt entry: // older native versions may have left several volumes stacked at /mnt. static int ac_log_mount_record(FILE *mountinfo, unsigned long visible_id, char *device, size_t capacity) { char line[4096]; while (fgets(line, sizeof(line), mountinfo)) { unsigned long id=0; char target[256]; if (sscanf(line,"%lu %*u %*s %*s %255s",&id,target)!=2 || id!=visible_id || strcmp(target,"/mnt")) continue; char *fields=strstr(line," - "); char source[256]=""; if(fields && sscanf(fields," - %*s %255s",source)==1 && !strncmp(source,"/dev/",5) && strlen(source)