[FFmpeg-devel] [PATCH] socklen_t definition

Rich Felker dalias
Mon Sep 17 12:43:03 CEST 2007


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.

Rich




More information about the ffmpeg-devel mailing list