From owner-freebsd-hackers Thu Nov 14 16:04:46 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA23222 for hackers-outgoing; Thu, 14 Nov 1996 16:04:46 -0800 (PST) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA23207 for ; Thu, 14 Nov 1996 16:04:36 -0800 (PST) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.6/8.7.3) with ESMTP id QAA10843; Thu, 14 Nov 1996 16:02:52 -0800 (PST) Message-Id: <199611150002.QAA10843@austin.polstra.com> To: "Marc G. Fournier" cc: Joe Greco , hackers@FreeBSD.org Subject: Re: Sockets question... In-reply-to: Your message of "Thu, 14 Nov 1996 18:47:16 EST." References: Date: Thu, 14 Nov 1996 16:02:52 -0800 From: John Polstra Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > > Are you checking the return value from write() to make sure it actually > > thinks that N bytes were _written_? > > > *sigh* Well now, wait a minute. As long as you haven't set the socket for non-blocking I/O, the write will always block until it's written the full N bytes that you asked for. In other words, the write will always return either -1 or N. Only if it's set up for non-blocking I/O can it return a short count. Writes are different from reads in this respect. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth