I’ve have been desperately searching for a tutorial on how to use the mount() function properly (they are very good at hiding this knowledge).
I need to use it to MNT_UPDATE ” / “(/dev/disk0s2 in this case) in single user mode but I can’t find an example or tutorial on how to use the function.
ps. Please no “Use system()”
pps. I know /sbin/mount exists for a reason, I’m doing this for education purposes
As you have probably already read in the man page, you use it like this:
The trick is what goes into “data”. It is a filesystem-specific structure that can be found by grepping for the filesystem name in system headers. For example, for HFS it’s in
/usr/include/hfs/hfs_mount.h: