[FFmpeg-devel] [PATCH] socklen_t definition
Mon Sep 17 22:51:58 CEST 2007
> Rich Felker wrote:
> > On Mon, Sep 17, 2007 at 11:32:05AM +0100, M?ns Rullg?rd wrote:
> >> As for the rest of the patch, how do we know that int is the
> > > correct
> >> type to use if socklen_t doesn't exist? Using the wrong type
> > > could
> >> be dangerous. On Beos we know it's int, but we can't be sure in
> > > the
> >> general case.
> > Read the RATIONALE section in POSIX on socklen_t. All of the
> > functions
> > that take socklen_t arguments originally took int. The problem was
> > that a few vendors decided to change their implementations to use a
> > new type that would be the system wordsize, so POSIX mandated a
> > socklen_t so that either behavior could be acceptable. But int is
> > the
> > correct type for socklen_t.
> > Hope I got that mostly accurate... It's from memory, too tired to
> > look
> > it up at the moment.
> Neither OS/2 nor Beos purport to be POSIX compliant, so nothing from
> POSIX text has any bearing on those OSes. If it did, there would be
> proper socklen_t definition and the issue wouldn't exist in the first
If POSIX didn't mandate socklen_t to support broken OSes in the first
place it wouldn't be needed. BeOS does support POSIX. Not all of it but
just enough to not have to support useless crap. And probably not the
last version because of the age, but that doesn't mean it doesn't
support it at all.
All portable software I know (those that are portable to OSes, not that
require porting OSes to them...) have proper checks for socklen_t with
autoconf (for once it's used correctly), before they were ported to
BeOS, so it's not because of it.
Besides Haiku will have it AFAIK.
More information about the ffmpeg-devel