Hi Nikos, Nikos Mavrogiannopoulos wrote: > I've noticed that some systems define AF_LOCAL in sys/socket.h while > others AF_UNIX and most define both. Could gnulib provide both > definitions (e.g. by this patch) to simplify their usage on various > platforms?
Gnulib is meant to allow people to program according to POSIX (and, to a lesser extent, GNU) APIs. Since POSIX [1] specifies the existence of AF_UNIX but not of AF_LOCAL, there is no point for Gnulib to support AF_LOCAL. Which are the platforms which provide AF_LOCAL but not AF_UNIX? I can't see any. I see some platforms which provide AF_UNIX but not AF_LOCAL (Minix, AIX, HP-UX 10, OSF/1, mingw, MSVC 9, Plan9). But since Gnulib's objective is to provide AF_UNIX, not AF_LOCAL, this list of platforms is not relevant. Also, which kind of program can use AF_UNIX without using <sys/un.h>? According to gnulib/doc/posix-headers/sys_un.texi, <sys/un.h> is missing on native Windows, and Gnulib provides no replacement for it. The reason is that Gnulib cannot just invent a new kind of socket, and things that are done with AF_UNIX sockets on Unix are often better done with pipes on Windows. Bruno [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html