@@ -184,6 +184,11 @@
#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
@@ -184,7 +184,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);