23,121
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <stdio.h>
#include <sys/mount.h>
int main(){
int mountfd = mount("/dev/sda10","/mnt/","vfat",MS_SYNCHRONOUS,"iocharse t=utf-8");
std::cout << mountfd << std::endl;
std::cout << MS_SYNCHRONOUS << std::endl;
perror("mount");
return 0;
}
int mountfd = mount("/dev/sda10","/mnt","vfat",MS_MGC_VAL,"iocharset=cp936,utf8");
18 #include <iostream>
19 #include <stdio.h>
20 #include <sys/mount.h>
21
22 int main(){
23 const char* device = "/home/jinger/Fedora-15-i686-Live-Desktop.iso";
24 //const char* device = "/dev/sda10";
25 const char* target = "/mnt";
26 const char* ftype = "iso9660";
27 //const char* ftype = "vfat";
28 int mountfd = mount(device,target,ftype,MS_RDONLY,"loop") ;
29 std::cout << mountfd << std::endl;
30 std::cout << MS_RDONLY << std::endl;
31 perror("mount");
32 return 0;
33 }