Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2007 14:40:40 +0200
From:      Stefan Farfeleder <stefan@fafoe.narf.at>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: socklen_t (Re: Multicast problems [PATCH])
Message-ID:  <20070620124040.GC929@lizard.fafoe.narf.at>
In-Reply-To: <Pine.GSO.4.64.0706200824530.4695@sea.ntplx.net>
References:  <46765CB9.9020105@incunabulum.net> <Pine.GSO.4.64.0706180833080.23884@sea.ntplx.net> <4676C30E.7040300@incunabulum.net> <Pine.GSO.4.64.0706181344060.24865@sea.ntplx.net> <4676C952.5000607@incunabulum.net> <4676D168.3050502@incunabulum.net> <4678529A.3080308@incunabulum.net> <Pine.GSO.4.64.0706191823040.1099@sea.ntplx.net> <20070620110702.GB929@lizard.fafoe.narf.at> <Pine.GSO.4.64.0706200824530.4695@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 20, 2007 at 08:34:46AM -0400, Daniel Eischen wrote:
>  On Wed, 20 Jun 2007, Stefan Farfeleder wrote:
> 
> > On Tue, Jun 19, 2007 at 06:36:39PM -0400, Daniel Eischen wrote:
> >
> >>  POSIX states that:
> >>
> >>    o The <sys/socket.h> header shall define the type socklen_t,
> >>      which is an integer type of width of at least 32 bits; see
> >>      APPLICATION USAGE.
> >>
> >>  and goes on to state:
> >>
> >>    o The <sys/socket.h> header shall define the unsigned integer
> >>      type sa_family_t.
> >>
> >>  This seems to imply that our socklen_t should not be an unsigned
> >>  integer (uint32_t), but a signed integer.  In APPLICATION USAGE,
> >>  POSIX states:
> >
> > I don't understand how you come to that conclusion.  Why does not
> > mentioning whether socklen_t is signed or unsigned imply it should be
> > signed?
> 
>  Because it explicitly says unsigned for sa_family_t and does not
>  say unsigned for socklen_t.  To me, "integer" means a C (signed)
>  integer.

It doesn't say signed or unsigned for socklen_t because both are
allowed.  Eg. regoff_t in <regex.h> is explicitly defined as a "signed
integer type".  I'm sure there are more, that's just the first one I
found.

Stefan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070620124040.GC929>