Home
last modified time | relevance | path

Searched refs:fsfd (Results 1 – 5 of 5) sorted by relevance

/linux/tools/testing/selftests/filesystems/
H A Dfclog.c53 int fsfd = fsopen("tmpfs", FSOPEN_CLOEXEC); in TEST_F() local
54 ASSERT_SUCCESS(fsfd); in TEST_F()
59 ASSERT_ERRNO_EQ(-ENODATA, read(fsfd, buf, sizeof(buf))); in TEST_F()
61 ASSERT_SUCCESS(close(fsfd)); in TEST_F()
66 int fsfd = fsopen("tmpfs", FSOPEN_CLOEXEC); in TEST_F() local
67 ASSERT_SUCCESS(fsfd); in TEST_F()
69 ASSERT_ERRNO_EQ(-EINVAL, fsconfig(fsfd, FSCONFIG_SET_STRING, "invalid-arg", "123", 0)); in TEST_F()
72 ASSERT_SUCCESS(read(fsfd, buf, sizeof(buf))); in TEST_F()
76 ASSERT_ERRNO_EQ(-ENODATA, read(fsfd, buf, sizeof(buf))); in TEST_F()
77 ASSERT_SUCCESS(close(fsfd)); in TEST_F()
[all …]
/linux/tools/testing/selftests/proc/
H A Dproc-pidns.c117 int fsfd = fsopen("proc", FSOPEN_CLOEXEC); in TEST_F() local
118 ASSERT_SUCCESS(fsfd); in TEST_F()
120 ASSERT_SUCCESS(fsconfig(fsfd, FSCONFIG_SET_STRING, "pidns", "/tmp/dummy/pidns", 0)); in TEST_F()
121 ASSERT_SUCCESS(fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0)); in TEST_F()
123 int mountfd = fsmount(fsfd, FSMOUNT_CLOEXEC, 0); in TEST_F()
129 ASSERT_SUCCESS(close(fsfd)); in TEST_F()
135 int fsfd = fsopen("proc", FSOPEN_CLOEXEC); in TEST_F() local
136 ASSERT_SUCCESS(fsfd); in TEST_F()
138 ASSERT_SUCCESS(fsconfig(fsfd, FSCONFIG_SET_FD, "pidns", NULL, self->dummy_pidns)); in TEST_F()
139 ASSERT_SUCCESS(fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0)); in TEST_F()
[all …]
H A Dproc-fsconfig-hidepid.c35 int fsfd, ret; in main() local
38 assert((fsfd = fsopen("proc", 0)) != -1); in main()
40 ret = fsconfig(fsfd, FSCONFIG_SET_BINARY, "hidepid", &hidepid, 0); in main()
44 assert(!fsconfig(fsfd, FSCONFIG_SET_STRING, "hidepid", "2", 0)); in main()
45 assert(!fsconfig(fsfd, FSCONFIG_SET_STRING, "hidepid", "invisible", 0)); in main()
47 assert(!close(fsfd)); in main()
/linux/tools/testing/selftests/filesystems/overlayfs/
H A Ddev_in_maps.c52 int tmpfs, fsfd, ovl; in ovl_mount() local
54 fsfd = sys_fsopen("tmpfs", 0); in ovl_mount()
55 if (fsfd == -1) in ovl_mount()
58 if (sys_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0) == -1) in ovl_mount()
61 tmpfs = sys_fsmount(fsfd, 0, 0); in ovl_mount()
65 close(fsfd); in ovl_mount()
77 fsfd = sys_fsopen("overlay", 0); in ovl_mount()
78 if (fsfd == -1) in ovl_mount()
80 if (sys_fsconfig(fsfd, FSCONFIG_SET_STRING, "source", "test", 0) == -1 || in ovl_mount()
81 sys_fsconfig(fsfd, FSCONFIG_SET_STRING, "lowerdir", "/tmp/l", 0) == -1 || in ovl_mount()
[all …]
/linux/samples/vfs/
H A Dtest-fsmount.c77 static inline int fsmount(int fsfd, unsigned int flags, unsigned int ms_flags) in fsmount() argument
79 return syscall(__NR_fsmount, fsfd, flags, ms_flags); in fsmount()
82 static inline int fsconfig(int fsfd, unsigned int cmd, in fsconfig() argument
85 return syscall(__NR_fsconfig, fsfd, cmd, key, val, aux); in fsconfig()
105 int fsfd, mfd; in main() local
108 fsfd = fsopen("afs", 0); in main()
109 if (fsfd == -1) { in main()
114 E_fsconfig(fsfd, FSCONFIG_SET_STRING, "source", "#grand.central.org:root.cell.", 0); in main()
115 E_fsconfig(fsfd, FSCONFIG_CMD_CREATE, NULL, NULL, 0); in main()
117 mfd = fsmount(fsfd, 0, MOUNT_ATTR_RDONLY); in main()
[all …]