Lines Matching full:ioctl
1 // Test that ioctl works in capability mode.
6 #include <sys/ioctl.h>
11 // Ensure that ioctl() works consistently for both regular file descriptors and
13 TEST(Ioctl, Basic) { in TEST() argument
28 EXPECT_OK(ioctl(fd, FIONREAD, &bytes)); in TEST()
29 EXPECT_NOTCAPABLE(ioctl(fd_no, FIONREAD, &bytes)); in TEST()
32 EXPECT_OK(ioctl(fd, FIOCLEX, &one)); in TEST()
33 EXPECT_NOTCAPABLE(ioctl(fd_no, FIOCLEX, &one)); in TEST()
40 TEST(Ioctl, SubRightNormalFD) { in TEST() argument
44 // Restrict the ioctl(2) subrights of a normal FD. in TEST()
48 EXPECT_OK(ioctl(fd, FIONREAD, &bytes)); in TEST()
50 EXPECT_NOTCAPABLE(ioctl(fd, FIOCLEX, &one)); in TEST()
72 TEST(Ioctl, PreserveSubRights) { in TEST() argument
110 TEST(Ioctl, SubRights) { in TEST() argument
131 EXPECT_OK(ioctl(fd, FIONREAD, &bytes)); in TEST()
133 EXPECT_OK(ioctl(fd, FIOCLEX, &one)); in TEST()
138 EXPECT_OK(ioctl(fd, FIONREAD, &bytes)); in TEST()
139 EXPECT_OK(ioctl(fd, FIOCLEX, &one)); in TEST()
159 EXPECT_OK(ioctl(fd_nread, FIONREAD, &bytes)); in TEST()
160 EXPECT_NOTCAPABLE(ioctl(fd_clex, FIONREAD, &bytes)); in TEST()
161 EXPECT_OK(ioctl(fd_clex, FIOCLEX, &one)); in TEST()
162 EXPECT_NOTCAPABLE(ioctl(fd_nread, FIOCLEX, &one)); in TEST()
183 EXPECT_NOTCAPABLE(ioctl(fd, FIONREAD, &bytes)); in TEST()
184 EXPECT_NOTCAPABLE(ioctl(fd, FIOCLEX, &one)); in TEST()
190 TEST(Ioctl, TooManySubRights) { in TEST() argument
211 TEST(Ioctl, ManySubRights) { in TEST() argument
227 // O(N^2) implementation of the ioctl list comparison. in TEST()