summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/socket_unix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/socket_unix.cc')
-rw-r--r--test/syscalls/linux/socket_unix.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/syscalls/linux/socket_unix.cc b/test/syscalls/linux/socket_unix.cc
index c60a965ae..8815ad849 100644
--- a/test/syscalls/linux/socket_unix.cc
+++ b/test/syscalls/linux/socket_unix.cc
@@ -14,6 +14,7 @@
#include "test/syscalls/linux/socket_unix.h"
+#include <errno.h>
#include <net/if.h>
#include <stdio.h>
#include <sys/ioctl.h>
@@ -1175,6 +1176,17 @@ TEST_P(UnixSocketPairTest, SocketShutdown) {
EXPECT_EQ(data, absl::string_view(buf, 3));
}
+// TODO: We should be returning ENXIO and NOT EIO.
+TEST_P(UnixSocketPairTest, DISABLED_SocketReopenFromProcfs) {
+ auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
+
+ // Opening a socket pair via /proc/self/fd/X is a ENXIO.
+ for (const int fd : {sockets->first_fd(), sockets->second_fd()}) {
+ ASSERT_THAT(Open(absl::StrCat("/proc/self/fd/", fd), O_WRONLY),
+ PosixErrorIs(ENXIO, ::testing::_));
+ }
+}
+
} // namespace
} // namespace testing