How can I, from a C program, read the hardware information of a drive? (I.e. to determine if the drive is an SSD or a mechanical disk.)
SSD are supposed to identify themselves as non-rotative. For linux, as example, you can get the info via sysfs:
cat /sys/block/sda/queue/rotational
If it returns 0, you have SSD...