[FFmpeg-devel] [PATCH] socklen_t definition

Måns Rullgård mans
Mon Sep 17 12:47:19 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 the
POSIX text has any bearing on those OSes.  If it did, there would be a
proper socklen_t definition and the issue wouldn't exist in the first
place.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list