From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 23:58:24 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 203D637B401 for ; Thu, 24 Apr 2003 23:58:24 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 617F943F75 for ; Thu, 24 Apr 2003 23:58:23 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h3P6wMA7054641; Fri, 25 Apr 2003 00:58:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 25 Apr 2003 00:57:50 -0600 (MDT) Message-Id: <20030425.005750.43494308.imp@bsdimp.com> To: wgrim@siue.edu From: "M. Warner Losh" In-Reply-To: References: <20030425031450.G8323-100000@foem.leiden.webweaving.org> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: recv() returning 0 and EINTR on a still connection. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 06:58:24 -0000 In message: William Michael Grim writes: : I think your problem is that n==0 does NOT mean the connection was closed : (at least not with TCP; I haven't really looked into other session : protocols). I know that it does with FreeBSD, at least for read(2). : If n==0, it only means you have stopped receiving data because there is no : more to be received; you can only trust errno if n==-1 or whatever the man : page specifies for your OS (FreeBSD is -1 in this case). FreeBSD returns -1 and EWOULDBLOCK in this case. Warner