bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect UNIX domain sockets supported by recent Windows versions.


From: Collin Funk
Subject: Re: Detect UNIX domain sockets supported by recent Windows versions.
Date: Wed, 24 Jul 2024 16:52:15 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Bruno,

Bruno Haible <bruno@clisp.org> writes:

> And a unit test would be nice as well. You know, it's only through the
> unit tests that we discover the portability problems.
>
> I think such a unit test shouldn't use fork(), like tests/test-passfd.c
> does, since fork() doesn't exist on native Windows. But
> tests/test-nonblocking-socket-{main,child}.c looks like a good starting point.

Sounds like a good idea to me too. Perhaps test-sys_un{.c,cc} like usual
and another test program for UNIX socket functionality if <sys/un.h> or
<afunix.h> is found.

I'm thinking that for older versions of Windows and systems without UNIX
sockets they should all be skipped.

I don't think there is much point in defining 'struct sockaddr_un' if
AF_UNIX is not supported. Maybe the tests should all be like:

#if HAVE_UNIXSOCKET
int
main ()
{
  /* Do test.  */
}
#else
int
main
{
  /* Skip test.  */
  exit (77);
}
#endif

But let me know if you have a better idea.

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]