Re: Linux has a broken shutdown syscall!

Andy Dougherty (doughera@lafcol.lafayette.edu)
Tue, 28 Apr 1998 14:36:45 -0400 (EDT)


On Fri, 24 Apr 1998, Alan Cox wrote:

> > Tom usually knows what he's talking about; is this really a problem
> > with Linux? What's going on here? :)
>
> Known 2.0.x bug.
>
> > 1) The call to PF_UNIX must be PF_UNSPEC (or 0) on SunOS and BSD,
> > even though it claims otherwise. There's some talk of PF_LOCAL,
> > but that's not even documented outside BSD. Linux will accept
> > either PF_UNIX or PF_UNSPEC there.
>
> PF_LOCAL is the POSIX 1003.1g name for local sockets. PF_UNIX isnt ok because
> POSIX is OS indepedant
>
> > 2) On Linux, shutdown is broken! You have to give it the opposite
> > argument! You must perversely do this:
> > shutdown(READER, 0);
> > shutdown(WRITER, 1);
>
> Its broken for AF_UNIX sockets only in 2.0.x. And yes known bug. Please
> don't fix it by reversing them, you'll break on newer kernels with the bug
> fixed.

Hmm. This is going to be tricky for Perl to deal with. I imagine we can
safely assume that 2.0.x kernels are going to be in widespread use for
quite a while (since they generally work so well). I could have Perl's
Configure detect and deal with this at build time, but since it is common
for folks to distribute Linux binaries, we can't assume that perl will
always run on the same kernel under which it was built.

I'm open to suggestions.

Andy Dougherty doughera@lafcol.lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu