https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118158

--- Comment #6 from Davide Pesavento <davidepesa at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> Do you have a testcase?

#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>

#include <filesystem>

#define SOCKET_NAME "/tmp/foo.sock"

int main()
{
  int sock = ::socket(AF_UNIX, SOCK_STREAM, 0);
  struct sockaddr_un name{};
  name.sun_family = AF_UNIX;
  ::strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) - 1);
  ::bind(sock, (struct sockaddr*) &name, sizeof(name));

  return std::filesystem::equivalent(SOCKET_NAME, SOCKET_NAME);
}

(In reply to Sam James from comment #2)
> (also, what platform?)

Sorry, Linux. But I believe it applies to all platforms that use stat(2).

Reply via email to