How do I loop mount programmatically?
问题 I have recently written a guide on how to mount partitions from image files on Raspberry Pi.SE. The instructions are rather complicated and I have a bit of time, so want to replace them by a C program. I have successfully listed the partitions of the image and calculated to appropriate offsets. In the original instructions, we needed to run $ sudo mount -o loop,offset=80740352 debian6-19-04-2012.img /mnt I now need to do this in code. I have found the mount function and libmount in util-linux