我正在尝试将源目录从nfs服务器挂载到具有linux的嵌入式主板中的目标目录.以下命令在板中的shell提示符中按预期完美地工作.
mount -t nfs -o nolock 10.126.62.45:/vol/home/avinoba/Sky /mnt
Run Code Online (Sandbox Code Playgroud)
在上面的命令的程序中使用的等效系统调用是什么?我尝试了以下调用但挂载失败并显示"无效参数"
if(mount("10.126.62.45:/vol/home/avinoba/Sky","/mnt","nfs",MS_MGC_VAL,"nolock") == -1)
{
printf("ERROR: mount failed: %s \n",strerror(errno));
}
Run Code Online (Sandbox Code Playgroud)
请建议解决方案是什么.
谢谢