Re: [PATCH] thread wakeup fix for 2.4.0-test7

From: Rusty Russell (
Date: Mon Aug 28 2000 - 06:22:35 EST

In message <8oci4c$b0l$> you write:
> >Actually, Linus seems to forget about his own idea
> >of returning valid error from close(). Think, how it is possible
> >to return valid error, when fput() is used to close file.
> Bzzt. Wrong answer.
> My claim is that a user program that does a close() on a file that is in
> use is inherently racy. Is that so hard to understand?

Easy to understand: you're wrong, that's all 8). It makes perfect
sense for the master thread to close the socket every thread is
waiting on, they all wake up, get -EBADF whether they be in read(),
poll(), etc. They then shut down. Neat, huh?

> (I'm also claiming that Linux will give the most reasonable possible
> semantics for the case where you _do_ close the file desciptor when it
> is in use. I still claim that you shouldn't do it.)

No, Solaris is more programmer-friendly here. That doesn't mean Linux
is wrong, just that the above claim is dubious.

Hope that helps,

Hacking time.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:22 EST