#include #include #include #include #include #include struct file_handle { int handle_size; int handle_type; void *f_handle; }; int main(int argc, char *argv[]) { int ret; int fd; int mntfd; struct file_handle fh; fh.handle_type = 0; fh.f_handle = malloc(100); fh.handle_size = 100/sizeof(int); errno = 0; printf("%s\n", argv[1]); int mntid = 20; ret = syscall(303, 0, argv[1], &fh, &mntid, 0); if (ret) { perror("303 Error:"); exit(1); } printf("%d - %d\n", mntid, fh.handle_size); printf("sleep\n"); sleep(60); mntfd = open("/data", O_RDONLY); printf("dir = %d\n", mntfd ); fd = syscall(304, mntfd, &fh, O_WRONLY); if (fd < 0 ) { perror("304 Error:"); exit(1); } printf("fd = %d\n", fd); write(fd, "toto", 4); if( close(fd) ) { printf("close failed\n"); } return 0; }