socket length arg fix (SAMBA_2_0 branch)

Jeremy Allison jallison at
Mon Dec 14 19:00:31 GMT 1998

Tim Rice wrote:
> On Mon, 14 Dec 1998, Andrej Borsenkow wrote:
> >
> > >
> > > This patch uses socklen_t which by default is typedefed int so this
> > > patch will NOT break any other systems.
> >
> > typedef'd int != int != size_t You create exactly the same problem you try
> > to solve (size_t most probably is already typedef'd to int). You have to
> > #define it
> On UnixWare size_t is thpedef'd uint_t which is typedef'd unsigned int.
> No, int != size_t.
> And socket length args are != int on some platforms.
> This is the way we solve the differences in the HylaFAX package.
> I works fine.

The problem, even with your patch, is that there is no
portable way to discover what prototype a particular
system is using for the last argument to accept() etc.

Some (modern) systems use socklen_t * (the new standard),
some use int *, some use unsigned int *.

We can check for socklen_t and use it if available,
but if not then whichever we pick (int or unsigned int)
is going to give compiler warnings on some systems.

Your patch helps, but I don't see it fixing it completely,
and (IMHO) it's still a bit of a storm in a teacup as
it's a compiler *warning* anyway. Stuff like the HPUX
compiler error messages and the AIX getrlimit bugs are
more important anyway. I don't want us to get *too*
obsessed with the details - there is still plenty 
of actual *coding* to be done :-) :-).



Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list