From owner-freebsd-hackers Fri May 22 14:14:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA18580 for freebsd-hackers-outgoing; Fri, 22 May 1998 14:14:10 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA18494 for ; Fri, 22 May 1998 14:13:52 -0700 (PDT) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.8.8/8.8.7) id HAA13177; Sat, 23 May 1998 07:19:25 +1000 (EST) (envelope-from jb) From: John Birrell Message-Id: <199805222119.HAA13177@cimlogic.com.au> Subject: Re: FreeBSD 2.2.6 + pthread == write() bug In-Reply-To: <199805222106.RAA05684@highwind.com> from HighWind Software Information at "May 22, 98 05:06:57 pm" To: info@highwind.com (HighWind Software Information) Date: Sat, 23 May 1998 07:19:25 +1000 (EST) Cc: jb@cimlogic.com.au, freebsd-hackers@FreeBSD.ORG, support@highwind.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG HighWind Software Information wrote: > A customer of ours pointed out that FreeBSD 3.0's uthread_write.c has > a "_thread_kern_sig_block(&status);" in there as well. Unknown if that > is the issue. -current has changed away from blocking signals for performance reasons, so I think that comment is a bit out-of-date. > I also believe that write() calls are returning "EAGAIN" sometimes and > writing data. Unless it actually returns an error, you shouldn't bother about what errno is set to because the library uses EAGAIN internally. > > It is supposed to return EAGAIN and have written NO data. That way, when > you retry the write() call, it doesn't resend the same data. Looking at the code, it doesn't check for a short write on a blocking fd. You are quite right, it should check the number of bytes written and keep looping until it has written the number of bytes required. It will take me a little while to update my 2.2.6 system (it normally runs -current). -- John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/ CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message