I am trying to use mount()
instead of mount
command in my program, I use the following mount()
successfully, the result returned success instead of Invalid Argument
.
int rc = mount("172.16.74.20:/data/redun/snmp","/mnt/data/redun/snmp",
"nfs",0,"soft,timeo=2,addr=172.16.74.20");
if (rc != 0)
{
printf("mount failed, errCode=%d, reason=%s\n",errno, strerror(errno));
}
But when I use df -h
to check the mountpoint, there are nothing displayed.
I found the related device was not mounted yet. What happened? Is it really mounted successfully? How can I display the mounted device by df
command in Linux?