From f26d5cd3cb349d6a5bb39a74ae28d47bd378c937 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 19 Jun 2009 12:47:49 +0200 Subject: [multiple changes] 2009-06-19 Thomas Quinot * i-vxwoio.ads: Add comments 2009-06-19 Thomas Quinot * socket.c, g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads, g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi.adb, g-socthi.ads, g-socket.adb, g-sothco.ads (GNAT.Sockets.Thin.C_Ioctl): Rename to Socket_Ioctl. (GNAT.Sockets.Thin.Socket_Ioctl): Use new function Thin_Common.Socket_Ioctl. (GNAT.Sockets.Thin_Common.Socket_Ioctl): Binding to new C wrapper __gnat_socket_ioctl. (__gnat_socket_ioctl): Wrapper for ioctl(2) called with a single int* argument after the file descriptor and request code. 2009-06-19 Robert Dewar * checks.adb: Minor reformatting From-SVN: r148694 --- gcc/ada/socket.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/ada/socket.c') diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 226f3be..df3b120 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -73,6 +73,7 @@ extern fd_set *__gnat_new_socket_set (fd_set *); extern void __gnat_remove_socket_from_set (fd_set *, int); extern void __gnat_reset_socket_set (fd_set *); extern int __gnat_get_h_errno (void); +extern int __gnat_socket_ioctl (int, int, int *); #if defined (__vxworks) || defined (_WIN32) extern int __gnat_inet_pton (int, const char *, void *); #endif @@ -409,6 +410,17 @@ __gnat_get_h_errno (void) { #endif } +/* Wrapper for ioctl(2), which is a variadic function */ + +int +__gnat_socket_ioctl (int fd, int req, int *arg) { +#if defined (_WIN32) + return ioctlsocket (fd, req, arg); +#else + return ioctl (fd, req, arg); +#endif +} + #ifndef HAVE_INET_PTON #ifdef VMS -- cgit v1.1