This is the mail archive of the 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]

[PATCH 3/3] gcc/ada/socket.c: Add conditionals for RTEMS

This patch is needed to make Ada compile for *-*-rtems*
on GCC 4.8, 4.9, and the head. Is is ok to commit?

2014-08-11  Joel Sherrill <>

	* socket.c: Add conditionals for RTEMS. Add include of <unistd.h>
	and so correct prototype of gethostbyname_r() is used.
 gcc/ada/socket.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index 4a9e6ad..631bfdc 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -60,6 +60,11 @@ typedef int IOCTL_Req_T;
 #include <string.h>
 /* Required for memcpy() */
+#if defined(__rtems__)
+#include <unistd.h>
+/* Required, for read(), write(), and close() */
 extern void __gnat_disable_sigpipe (int fd);
 extern void __gnat_disable_all_sigpipes (void);
 extern int  __gnat_create_signalling_fds (int *fds);
@@ -184,7 +189,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);
   rh = gethostbyname_r (name, ret, buf, buflen, h_errnop);

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