[lkml]   [2001]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: PROBLEM: I/O system call never returns if file desc is closed in the

On Thu, 7 Jun 2001, Matthias Urlichs wrote:

> Select is defined as to return, with the appropriate bit set, if/when
> a nonblocking read/write on the file descriptor won't block. You'd
> get EBADF in this case, therefore causing the select to return would
> be a Good Thing.

Bzzert. Wrong. It may easily block. open() from another thread might
grab that descriptor just fine.

If you close descriptors being polled - don't try IO on them once
select()/poll() returns. Regardless of aborting select().

> A related problem is that the second thread my be inside a blocking
> read() instead of a select() call. It'd never continue. :-(

Yes. So close() doesn't abort read(). Why would it?

Operations like read, select, etc. act of files. Not on descriptors.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:54    [W:0.079 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site