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: clean up of gnat.socket code


Tested on x86-windows

Cleanup of GNAT.Socket code:

C_Read and C_Write in g-socthi are not portable (they won't work under
Windows), and not used anywhere within g-sockets.

C_Select is misnamed, since at least in the mingw version it is actually
a nontrivial wrapper around the actual select library function (imported
in g-socthi-mingw as Standard_Select). Code reorganized to ensure that
C_Select is used uniformly as the name of the imported function, and
rename the wrapper to Thin.Select.

2004-10-26  Vincent Celier  <celier@gnat.com>
	    Thomas Quinot   <quinot@act-europe.fr>

	* g-socthi-vms.adb, g-socthi-mingw.adb, g-socthi-vxworks.ads:
	(C_Writev): Change MSG_Forced_Flags to Constants.MSG_Forced_Flags as
	there is no use of GNAT.Sockets.Constants.
	Remove remaining pragma Import for C_Write
	Remove C_Read and C_Write from internal implementation unit
	GNAT.Sockets.Thin, as their usage for sockets is non-portable (using
	the read and write functions from the system runtime library is fine
	on UNIX but won't work under Windows).

	* g-socket.adb: (Abort_Selector): Use C_Send instead of C_Write.
	(Check_Selector): Use C_Recv instead of C_Read.
	Selectors are the GNAT.Sockets abstraction to perform a select()
	call on a set of descriptors. To allow abortion of an ongoing
	select operation, some data is written to a dedicated socket that
	is always monitored.
	Under Windows, the write and read library functions cannot operate
	on sockets, so we need to use send and recv instead, which is portable
	across all supported platforms.

	* g-socthi.ads: Remove C_Read and C_Write from internal implementation
	unit GNAT.Sockets.Thin, as their usage for sockets is non-portable
	(using the read and write functions from the system runtime library is
	fine on UNIX but won't work under Windows).

Attachment: difs.1
Description: Text document


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