Date: Wed, 28 Aug 2002 11:07:26 -0700 (PDT) From: Archie Cobbs <archie@dellroad.org> To: freebsd-net@freebsd.org Cc: eischen@pcnet1.pcnet.com Subject: Fix for bug in accept() on non-blocking socket Message-ID: <200208281807.g7SI7Qg44023@arch20m.dellroad.org>
next in thread | raw e-mail | index | archive | help
Hello -net,
Would anyone interested please review the patch to uipc_syscalls.c
contained in bin/42100 ?
http://www.freebsd.org/cgi/query-pr.cgi?pr=42100
The problem relates to the behavior of accept() when called on a
socket that has been shutdown(2) for reading.
Normally, this causes ECONNABORTED to be returned. However, if the
socket is marked non-blocking (O_NONBLOCK), then EAGAIN is returned.
This of course is the return value that means 'no data available; try
again' for a non-blocking socket. Not a good choice :-)
This patch fixes things so ECONNABORTED is returned in the non-blocking
case as well.
Also: I remember someone complaining that the pthread(3) version of
Apache does not work on FreeBSD because some thread ends up spinning
and eating 100% CPU. This bug could possibly be related to that problem.
Might be worth a try...
Thanks,
-Archie
__________________________________________________________________________
Archie Cobbs * Packet Design * http://www.packetdesign.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208281807.g7SI7Qg44023>
