I would like to programmatically mount a volume from my code and I am using the mount system call for that. I have ecryptfs installed. To manually mount a volume, I can use mount -t ecryptfs /src /dst and this will cause ecryptfs to interactively ask me for the information.
I would like it to instead automatically use my key file that I point it at and proceed.
You can use the echo command to take password automatically while mounting with eCryptFs,
Example:
If you want use it in your code, then form the above string by extracting password from your file and use system API
(system("");)to mount the partition with eCryptFS.