autoconf check for AF_UNIX sockets

Started by Horák Danielover 25 years ago5 messageshackers
Jump to latest
#1Horák Daniel
horak@sit.plzen-city.cz

Hello,

can our autoconf guru create a test for checking the availability of AF_UNIX
sockets? It could be defined in config.h as HAVE_UNIX_SOCKET or similar. It
will enable to use them in the newest cygwin where are this sockets
implemented.

Dan

----------------------------------------------
Daniel Horak
network and system administrator
e-mail: horak@sit.plzen-city.cz
privat e-mail: dan.horak@email.cz ICQ:36448176
----------------------------------------------

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Horák Daniel (#1)
Re: autoconf check for AF_UNIX sockets

Hor�k Daniel writes:

can our autoconf guru create a test for checking the availability of AF_UNIX
sockets? It could be defined in config.h as HAVE_UNIX_SOCKET or similar. It
will enable to use them in the newest cygwin where are this sockets
implemented.

I'll check into it. (No presumptions about guru status made... :-) )

--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Eisentraut (#2)
Re: autoconf check for AF_UNIX sockets

I wrote:

can our autoconf guru create a test for checking the availability of AF_UNIX
sockets? It could be defined in config.h as HAVE_UNIX_SOCKET or similar. It
will enable to use them in the newest cygwin where are this sockets
implemented.

I'll check into it.

A classical Autoconf test is impractical. First of all there's no reliable
compile-time evidence regarding these Unix sockets so we'd have to run a
program from configure. That's already a semi-no-no because it will break
cross-compilation and it also sounds a bit like a security concern.
Moreover, it's still doubtful whether you could learn a lot this way,
perhaps the user that runs configure cannot create these sockets or not
where configure is trying to create it, etc.

I have added a HAVE_UNIX_SOCKETS symbol into config.h.in that currently
checks !defined(__CYGWIN__) && !defined(__QNX__) in the accustomed manner.
You could extend it with specific Cygwin version checks.

--
Peter Eisentraut Sernanders v�g 10:115
peter_e@gmx.net 75262 Uppsala
http://yi.org/peter-e/ Sweden

#4The Hermit Hacker
scrappy@hub.org
In reply to: Peter Eisentraut (#3)
Re: autoconf check for AF_UNIX sockets

On Sun, 20 Aug 2000, Peter Eisentraut wrote:

I wrote:

can our autoconf guru create a test for checking the availability of AF_UNIX
sockets? It could be defined in config.h as HAVE_UNIX_SOCKET or similar. It
will enable to use them in the newest cygwin where are this sockets
implemented.

I'll check into it.

A classical Autoconf test is impractical. First of all there's no reliable
compile-time evidence regarding these Unix sockets so we'd have to run a
program from configure. That's already a semi-no-no because it will break
cross-compilation and it also sounds a bit like a security concern.
Moreover, it's still doubtful whether you could learn a lot this way,
perhaps the user that runs configure cannot create these sockets or not
where configure is trying to create it, etc.

can't you just do a link test that checks that AF_UNIX is defined?

#5Horák Daniel
horak@sit.plzen-city.cz
In reply to: The Hermit Hacker (#4)
RE: autoconf check for AF_UNIX sockets

can't you just do a link test that checks that AF_UNIX is defined?

That doesn't say anything about whether the Unix sockets
really work, as
systems where they don't work define this occasionally.

My idea was to create a test that will try to compile, link and run a small
program. The program should contain "int s = socket(AF_UNIX, ...) and a test
for succesful creation of 's'. Only when this program will compile and run
OK then it should be defined HAVE_AF_UNIX_SOCKET.

Dan