bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sys_socket: sockaddr_storage


From: Tom G. Christensen
Subject: Re: sys_socket: sockaddr_storage
Date: Fri, 8 May 2009 09:02:16 +0200
User-agent: Mutt/1.4.2.2i

On Fri, May 08, 2009 at 01:44:57AM +0200, Bruno Haible wrote:
> Simon Josefsson wrote:
> > +#define _SS_PADSIZE     (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
> 
> If the goal is that sizeof (struct sockaddr_storage) == _SS_SIZE, then the
> formula is incorrect. It should be
>   (_SS_SIZE - (max (sizeof (sa_family_t), alignof (__ss_aligntype)) + sizeof 
> (__ss_aligntype)))
> 
> > +#define _SS_SIZE        128
> 
> Is this enough for all platforms? Let's see...
> 
> - IRIX 6.5 has no 'struct sockaddr_storage' but all 'struct sockaddr_*' 
> variants
>   are less than 64 bytes in size.
> 
IRIX 6.5.30 has 'struct sockaddr_storage' and it is defined as size 128.

-tgc




reply via email to

[Prev in Thread] Current Thread [Next in Thread]