We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8ca403 commit 25a6cc9Copy full SHA for 25a6cc9
tools/testing/selftests/filesystems/anon_inode_test.c
@@ -48,5 +48,22 @@ TEST(anon_inode_no_exec)
48
EXPECT_EQ(close(fd_context), 0);
49
}
50
51
+TEST(anon_inode_no_open)
52
+{
53
+ int fd_context;
54
+
55
+ fd_context = sys_fsopen("tmpfs", 0);
56
+ ASSERT_GE(fd_context, 0);
57
58
+ ASSERT_GE(dup2(fd_context, 500), 0);
59
+ ASSERT_EQ(close(fd_context), 0);
60
+ fd_context = 500;
61
62
+ ASSERT_LT(open("/proc/self/fd/500", 0), 0);
63
+ ASSERT_EQ(errno, ENXIO);
64
65
+ EXPECT_EQ(close(fd_context), 0);
66
+}
67
68
TEST_HARNESS_MAIN
69
0 commit comments