]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
socket.c: For RTEMS, use correct prototype of gethostbyname_r().
authorJoel Sherrill <joel.sherrill@oarcorp.com>
Tue, 12 Aug 2014 19:49:22 +0000 (19:49 +0000)
committerJoel Sherrill <joel@gcc.gnu.org>
Tue, 12 Aug 2014 19:49:22 +0000 (19:49 +0000)
2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>

* socket.c: For RTEMS, use correct prototype of gethostbyname_r().
* gsocket.h Add include of <unistd.h> on RTEMS.

From-SVN: r213883

gcc/ada/ChangeLog
gcc/ada/gsocket.h
gcc/ada/socket.c

index 5a4872d6b718ea649639a415f3ed2e0e9201839c..a430c4b36d4c74623bc51840fd88ed1b7f82af00 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-12  Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * socket.c: For RTEMS, use correct prototype of gethostbyname_r().
+       * gsocket.h Add include of <unistd.h> on RTEMS.
+
 2014-08-11  Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * s-osinte-rtems.adb: Correct formatting of line in license block.
index e21d7142701f71725c4e561f822bc78deaf56034..1d9235f4ad822fd25e8d0f474c9bdba58a47784d 100644 (file)
 #include <sys/time.h>
 #endif
 
+#if defined(__rtems__)
+#include <unistd.h>
+/* Required, for read(), write(), and close() */
+#endif
+
 /*
  * RTEMS has these .h files but not until you have built and installed RTEMS.
  * When building a C/C++ toolset, you also build the newlib C library, so the
index 18999b394ea5504b46a926b1fe9fed733ee04736..e65845628a1d0480471b828557f4f448f799fbf2 100644 (file)
@@ -212,7 +212,7 @@ __gnat_gethostbyname (const char *name,
   struct hostent *rh;
   int ri;
 
-#if defined(__linux__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__GLIBC__) || defined(__rtems__)
   (void) gethostbyname_r (name, ret, buf, buflen, &rh, h_errnop);
 #else
   rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);