This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] GNAT.Socket improvements


Tested on i686-linux, committed on HEAD

The writev(2) system call, when implemented, may not be used for a set
of iovec more than IOV_MAX (an implementation-defined limit) iovecs.
This change takes this limitation into account and spans vectors
longer than IOV_MAX across multiple writev(2) calls. For platforms that
do not have writev(2), we emulate it in g-socthi with a function that
does not have this limitation, and accordingly IOV_MAX is set to
UINT_MAX in the corrsponding version of g-soccon.ads.

gen-soccon is used to regenerate GNAT.Sockets.Constants from system
headers. This change also improves the portability of this tool, and adds
a new constant, IOV_MAX (maximum number of iovecs that can be passed to
writev(2)).

2005-09-01  Thomas Quinot  <quinot@adacore.com>

	* g-soccon-vms.adb: Renamed to g-soccon-vms.ads

	* g-soccon-vms.ads: Renamed from g-soccon-vms.adb

	* g-soccon.ads, g-soccon-tru64.ads, g-soccon-aix.ads,
	g-soccon-darwin.ads, g-soccon-irix.ads, g-soccon-hpux.ads,
	g-soccon-solaris.ads, g-soccon-mingw.ads, g-soccon-vxworks.ads,
	g-soccon-freebsd.ads: Add new constants:
	 IP_MULTICAST_IF
	 SO_RCVTIMEO/SO_SNDTIMEO
	 IOV_MAX

	* gen-soccon.c: 
	Move all target-specific file inclusions and macro definitions to
	gsocket.h, in order to ensure that any C code in socket.c will see a
	set of constants that is consistent with the contents of g-soccon.ads.

	* gsocket.h: Code imported from gen-soccon.c:
	Move all target-specific file inclusions and macro definitions to
	gsocket.h, in order to ensure that any C code in socket.c will see a set
	of constants that is consistent with the contents of g-soccon.ads.
	This change also makes gen-soccon self-contained (removing dependencies
	upon GCC internal headers).

	* g-socket.adb (Send_Vector): Make calls to Writev at most IOV_MAX
	iovecs at a time.
	(To_Inet_Addr): Now a procedure instead of a function, more efficient.

	* socket.c: Minor reformatting.

Attachment: difs.7
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]