Re: glibc 2, Linux 2.x and the world of many patches!

Linus Torvalds (torvalds@transmeta.com)
Thu, 31 Jul 1997 12:08:38 -0700 (PDT)


On Thu, 31 Jul 1997, Todd Larason wrote:
>
> On Thu, Jul 31, 1997 at 05:16:31PM +0000, Linus Torvalds wrote:
> >
> > Oh, no! Don't tell me that glibc now tries to implement the completely
> > broken new POSIX standard for size_t of socket names?
>
> I haven't seen the POSIX spec, but the new X/Open Single Unix Spec uses a
> new unsigned integral type, at least 32 bits, called socklen_t, for all
> sockaddr lengths. This doesn't seem TOO broken to me.
>
> Did X/Open fix POSIX's bungle?

Halleluja. Yes, they fixed it. And maybe that implies that POSIX will fix
it too (or maybe they _have_ fixed it, and nobody told me even though I
complained to them).

Using a seprate "socklen_t" is fine, because that allows existing
implementations (and any new implementations that want to be able to run
standard BSD programs instead of running the imaginary programs that are
written to POSIX specs) to just make socklen_t be the same size as "int".

You couldn't reasonably have done the same with "size_t", because you
really want to have a size_t that can span most of your address space.

(The 32-bit minumum size would still mean that 16-bit UNIXen have problems
with trying to be Unix98 branded, but I have to say that that doesn't
strike me as being a major problem in this day and age ;)

Linus