[PATCH][Ada] Updated GNAT Socket So *-rtems* Continues to Work

Joel Sherrill joel.sherrill@oarcorp.com
Tue Jul 22 16:45:00 GMT 2008


Arnaud Charlet wrote:
>> Index: gen-soccon.c
>> ===================================================================
>> --- gen-soccon.c      (revision 136364)
>> +++ gen-soccon.c      (working copy)
>> @@ -156,8 +156,10 @@
>>  #ifndef AF_INET6
>>  # define AF_INET6 -1
>>  #else
>> +#ifndef __rtems__
>>  # define HAVE_AF_INET6 1
>>  #endif
>> +#endif
>>  CND(AF_INET6, "IPv6 address family")
>>  _NL
>>  TXT("   -----------")
>>     
>
> This part will become obsolete soon, since we've redone this part without
> the need to run a target executable.
>   
And how will you generate this when you don't have access
to the network .h files when the run-time is built?
> Still, this change looks dubious, it's not logical to have AF_INET6 defined and
> no struct sockaddr_in6 (HAVE_AF_INET6 is used only to indicate whether
> we can take sizeof (struct sockaddr_in6)). Is it really the case that RTEMS
> defines AF_INET6 but doesn't provide struct sockaddr_in6?
>
>   
Believe it or not this is true.  The TCP/IP stack is a port of
an older FreeBSD version with some updates for better ANSI
C99 headers.  The sys/socket.h is one of those updated .h files
and includes this constant.

Eventually the stack will get updated completely but for now
this part of the .h files lies.
>> Index: gsocket.h
>> ===================================================================
>> --- gsocket.h (revision 136364)
>> +++ gsocket.h (working copy)
>> @@ -185,7 +185,7 @@
>>  # define Need_Netdb_Buffer 0
>>  #endif
>>
>> -#if defined (__FreeBSD__) || defined (__vxworks)
>> +#if defined (__FreeBSD__) || defined (__vxworks) || defined (__rtems__)
>>  # define Has_Sockaddr_Len 1
>>  #else
>>  # define Has_Sockaddr_Len 0
>>     
>
> This part is OK.
> g-soccon-rtems.ads part is OK too.
>
> Arno
>   


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985




More information about the Gcc-patches mailing list