Re: close() of active socket does not work on FreeBSD 6



On Tue, Dec 12, 2006 at 09:08:30AM -0500, Daniel Eischen wrote:
On Tue, 12 Dec 2006, Kostik Belousov wrote:

On Tue, Dec 12, 2006 at 08:18:32AM -0500, Daniel Eischen wrote:
It's also couldn't be entirely solved by fixing it in the
threads library. You could still have a non-threaded
application that waits on a read operation, but receives
a signal and closes the socket in the signal handler.

This is not the problem. The read (as syscall being executed) is aborted
when signal is delivered. Original poster considered situation where
read() is active (in particular, f_count of struct file is incremented
by fget, that caused the reported behaviour).

Even when SA_RESTART is set?

Yes. Since SA_RESTART causes syscall to be reissued, read()
would fail with EBADFD on its own.

Attachment: pgpFuUYr8x2Tb.pgp
Description: PGP signature



Relevant Pages