OSDN Git Service

2007-04-20 Thomas Quinot <quinot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:48:51 +0000 (10:48 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 10:48:51 +0000 (10:48 +0000)
* g-soccon-darwin.ads, gen-soccon.c: Add new constant
Thread_Blocking_IO, always True by default, set False on a per-runtime
basis.
Add Windows-specific constants
Add new constant Need_Netdb_Buffer.
Add new macros to indicate whether getXXXbyYYY is thread safe and, if
not, whether to use getXXXbyYYY_r.

* gsocket.h: Add new constant Need_Netdb_Buffer.
Add new macros to indicate whether getXXXbyYYY is thread safe and, if
not, whether to use getXXXbyYYY_r.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125466 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/g-soccon-darwin.ads
gcc/ada/gen-soccon.c
gcc/ada/gsocket.h

index 4ae827d..7d82375 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2000-2005, Free Software Foundation, Inc.         --
+--          Copyright (C) 2000-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -35,7 +35,7 @@
 --  by the GNAT.Sockets package (g-socket.ads). This package should not be
 --  directly with'ed by an applications program.
 
---  This is the version for powerpc-apple-darwin7.4.1
+--  This is the version for powerpc-apple-darwin8.8.0
 --  This file is generated automatically, do not modify it by hand! Instead,
 --  make changes to gen-soccon.c and re-run it on each target.
 
@@ -167,7 +167,7 @@ package GNAT.Sockets.Constants is
    -- System limits --
    -------------------
 
-   IOV_MAX            : constant :=  2147483647; --  Maximum writev iovcnt
+   IOV_MAX            : constant :=        1024; --  Maximum writev iovcnt
 
    ----------------------
    -- Type definitions --
@@ -178,4 +178,17 @@ package GNAT.Sockets.Constants is
    SIZEOF_tv_sec      : constant :=           4; --  tv_sec
    SIZEOF_tv_usec     : constant :=           4; --  tv_usec
 
+   ----------------------------------------
+   -- Properties of supported interfaces --
+   ----------------------------------------
+
+   Need_Netdb_Buffer  : constant :=           1; --  Need buffer for Netdb ops
+
+   ----------------------
+   -- Additional flags --
+   ----------------------
+
+   Thread_Blocking_IO : constant Boolean := True;
+   --  Set False for contexts where socket i/o are process blocking
+
 end GNAT.Sockets.Constants;
index e828433..d52ba5f 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                          *
  *                           G E N - S O C C O N                            *
  *                                                                          *
- *          Copyright (C) 2004-2005, Free Software Foundation, Inc.         *
+ *          Copyright (C) 2004-2007, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -98,7 +98,7 @@ TXT("--               G N A T . S O C K E T S . C O N S T A N T S
 TXT("--                                                                          --")
 TXT("--                                 S p e c                                  --")
 TXT("--                                                                          --")
-TXT("--          Copyright (C) 2000-2005, Free Software Foundation, Inc.         --")
+TXT("--          Copyright (C) 2000-2007, Free Software Foundation, Inc.         --")
 TXT("--                                                                          --")
 TXT("-- GNAT is free software;  you can  redistribute it  and/or modify it under --")
 TXT("-- terms of the  GNU General Public License as published  by the Free Soft- --")
@@ -589,6 +589,14 @@ CND(SIZEOF_tv_sec, "tv_sec")
 CND(SIZEOF_tv_usec, "tv_usec")
 }
 
+_NL
+TXT("   ----------------------------------------")
+TXT("   -- Properties of supported interfaces --")
+TXT("   ----------------------------------------")
+_NL
+
+CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
+
 #ifdef __vxworks
 _NL
 TXT("   --------------------------------")
@@ -603,6 +611,31 @@ CND(OK,    "VxWorks generic success")
 CND(ERROR, "VxWorks generic error")
 #endif
 
+#ifdef __MINGW32__
+_NL
+TXT("   ------------------------------")
+TXT("   -- MinGW-specific constants --")
+TXT("   ------------------------------")
+_NL
+TXT("   --  These constants may be used only within the MinGW version of")
+TXT("   --  GNAT.Sockets.Thin.")
+_NL
+
+CND(WSASYSNOTREADY,     "System not ready")
+CND(WSAVERNOTSUPPORTED, "Version not supported")
+CND(WSANOTINITIALISED,  "Winsock not intialized")
+CND(WSAEDISCON,         "Disconnected")
+
+#endif
+
+_NL
+TXT("   ----------------------")
+TXT("   -- Additional flags --")
+TXT("   ----------------------")
+_NL
+TXT("   Thread_Blocking_IO : constant Boolean := True;")
+TXT("   --  Set False for contexts where socket i/o are process blocking")
+
 _NL
 TXT("end GNAT.Sockets.Constants;")
 
index a380788..7df7ea0 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                              C Header File                               *
  *                                                                          *
- *         Copyright (C) 2004-2005, Free Software Foundation, Inc.          *
+ *         Copyright (C) 2004-2006, Free Software Foundation, Inc.          *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
 #include <sys/ioctl.h>
 #include <netdb.h>
 #endif
+
+/*
+ * Handling of gethostbyname, gethostbyaddr, getservbyname and getservbyport
+ * =========================================================================
+ *
+ * The default implementation of GNAT.Sockets.Thin requires that these
+ * operations be either thread safe, or that a reentrant version getXXXbyYYY_r
+ * be provided. In both cases, socket.c provides a __gnat_safe_getXXXbyYYY
+ * function with the same signature as getXXXbyYYY_r. If the operating
+ * system version of getXXXbyYYY is thread safe, the provided auxiliary
+ * buffer argument is unused and ignored.
+ *
+ * Target specific versions of GNAT.Sockets.Thin for platforms that can't
+ * fulfill these requirements must provide their own protection mechanism
+ * in Safe_GetXXXbyYYY, and if they require GNAT.Sockets to provide a buffer
+ * to this effect, then we need to set Need_Netdb_Buffer here (case of
+ * VxWorks and VMS).
+ */
+
+#if defined (_AIX) || defined (__FreeBSD__) || defined (__hpux__) || defined (__osf__) || defined (_WIN32) || defined (__APPLE__)
+# define HAVE_THREAD_SAFE_GETxxxBYyyy 1
+#elif defined (sgi) || defined (linux) || (defined (sun) && defined (__SVR4) && !defined (__vxworks))
+# define HAVE_GETxxxBYyyy_R 1
+#endif
+
+#if defined (HAVE_GETxxxBYyyy_R) || !defined (HAVE_THREAD_SAFE_GETxxxBYyyy)
+# define Need_Netdb_Buffer 1
+#else
+# define Need_Netdb_Buffer 0
+#endif