[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AF_LOCAL vs AF_UNIX
From: |
Bruno Haible |
Subject: |
Re: AF_LOCAL vs AF_UNIX |
Date: |
Thu, 12 Apr 2012 11:42:23 +0200 |
User-agent: |
KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) |
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
- AF_LOCAL vs AF_UNIX, Nikos Mavrogiannopoulos, 2012/04/12
- Re: AF_LOCAL vs AF_UNIX,
Bruno Haible <=