Core LibraryalphaAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux-cxx latest

same_socket_inode

Whether two paths name the same socket.

Source and package
Qualified name
libtmux::test::same_socket_inode
Namespace
libtmux::test
Package
libtmux-cxx
Source
include/libtmux/testing/scoped_server.hpp
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] libtmux::expected<bool, std::string> same_socket_inode(const std::filesystem::path& left, const std::filesystem::path& right);

Description#

Not std::filesystem::equivalent: [fs.op.equivalent] makes it an error when both paths are "other" files, and a unix domain socket is one. That is not a corner a tmux suite can avoid — every socket comparison hits it — and the two standard libraries disagree about it. libstdc++ implements the rule and reports ENOTSUP; libc++ answers anyway, so the same test passes on one and fails on the other. This asks the kernel for the inode instead.

The error is for a path that could not be inspected at all; a readable pair that names two different sockets is a false, not a failure.

Parameters
Esc

Type to search.

Reference previewOpen reference