Commit graph

3 commits

Author SHA1 Message Date
Iain Sandoe
99fcd602a8 libcody: Do not use a dummy port number in getaddrinfo().
the getaddrinfo() requires either a non-null name for the server or
a port service / number.  In the code that opens a connection we have
been calling this with a dummy port number of "0".  Unfortunately this
triggers a bug in some BSD versions and OSes importing that code.

In this part of the code we do not really need a port number, since it
is not reasonable to open a connection to an unspecified host.

Setting hints info field to 0, and the servname parm to nullptr works
around the BSD bug in this case.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libcody/ChangeLog:

	* netclient.cc (OpenInet6): Do not provide a dummy port number
	in the getaddrinfo() call.
2022-03-18 15:23:23 +00:00
Nathan Sidwell
31705b068f libcody: Add netinet.h
We explicitly need to inlude netinet.h, (despite what happened on my test systems)

	libcody/
	* netclient.cc: Add netinet.h.
2020-12-21 05:42:03 -08:00
Nathan Sidwell
362303298a Add libcody
In order to separate compiler from build system, C++ Modules, as
implemented in GCC introduces a communication channel between those
two entities.  This is implemented by libcody.  It is anticipated that
other implementations will also implement this protocol, or use
libcody to provide it.

	* Makefile.def: Add libcody.
	* configure.ac: Add libcody.
	* Makefile.in: Regenerated.
	* configure: Regenerated.
	gcc/
	* Makefile.in (CODYINC, CODYLIB, CODYLIB_H): New. Use them.
	libcody/
	* configure.ac: New.
	* CMakeLists.txt: New.
	* CODING.md: New.
	* CONTRIB.md: New.
	* LICENSE: New.
	* LICENSE.gcc: New.
	* Makefile.in: New.
	* Makesub.in: New.
	* README.md: New.
	* buffer.cc: New.
	* build-aux/config.guess: New.
	* build-aux/config.sub: New.
	* build-aux/install-sh: New.
	* client.cc: New.
	* cmake/libcody-config-ix.cmake
	* cody.hh: New.
	* config.h.in: New.
	* config.m4: New.
	* configure: New.
	* configure.ac: New.
	* dox.cfg.in: New.
	* fatal.cc: New.
	* gdbinit.in: New.
	* internal.hh: New.
	* netclient.cc: New.
	* netserver.cc: New.
	* packet.cc: New.
	* resolver.cc: New.
	* server.cc: New.
	* tests/01-serialize/connect.cc: New.
	* tests/01-serialize/decoder.cc: New.
	* tests/01-serialize/encoder.cc: New.
	* tests/02-comms/client-1.cc: New.
	* tests/02-comms/pivot-1.cc: New.
	* tests/02-comms/server-1.cc: New.
	* tests/Makesub.in: New.
	* tests/jouster: New.
2020-12-15 07:09:59 -08:00