From owner-freebsd-hackers Sun Jan 25 16:09:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA04658 for hackers-outgoing; Sun, 25 Jan 1998 16:09:57 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from proxy-bsb.gns.com.br (e9lNrh9Vp2J6ZOflrC+0cmq0XPk4ktme@srv1-bsb.GNS.com.br [200.239.56.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id QAA04645 for ; Sun, 25 Jan 1998 16:09:47 -0800 (PST) (envelope-from dcs@gns.com.br) Received: (qmail 29288 invoked from network); 26 Jan 1998 00:05:08 -0000 Received: from unknown (HELO srv1-bsb.gns.com.br) (unknown) by unknown with SMTP; 26 Jan 1998 00:05:08 -0000 Received: (from mail@localhost) by srv1-bsb.gns.com.br (8.8.8/8.8.8) id WAA29284; Sun, 25 Jan 1998 22:05:08 -0200 (EDT) Received: from dl0235-bsb.gns.com.br(200.239.56.235) by srv1-bsb.gns.com.br via smap (V2.0) id xma029258; Sun, 25 Jan 98 22:04:26 -0200 Received: (from dcs@localhost) by daniel.sobral (8.8.8/8.8.6) id MAA00740; Sun, 25 Jan 1998 12:52:13 -0200 (EDT) From: "Daniel C. Sobral" Message-Id: <199801251452.MAA00740@daniel.sobral> Subject: uiomove() In-Reply-To: <199801241656.IAA24947@hub.freebsd.org> from freebsd-hackers-digest at "Jan 24, 98 08:56:16 am" To: hackers@FreeBSD.ORG Date: Sun, 25 Jan 1998 12:52:12 -0200 (EDT) Disclaimer: Klaatu Barada Nikto! X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > OK. Here's a more "politically correct" read() routine. You should be > able to mirror this into a write() fairly easily. > [snip] > if (result = ERESTART) > if (got == 0) > result = 0; > else > result = EINTR; [snip] > > You might want to always convert ERESTART to EINTR (always error on > interrupt), but that becomes more complex as you may already have > consumed data from the read buffer, which may throw your caller out of > sync. > > Another approach is to ignore ERESTART, ie. never return a short count. > That's also quite legitimate with the above code, ie. > > if (result == ERESTART) > result = 0; I don't quite get it. My code can actually restart at any point, except for struture uio. What's the _purpose_ of ERESTART? -- Daniel C. Sobral (8-DCS) dcs@gns.com.br There was a young gaucho named Bruno Who said, "There is one thing I do know, Women are fine And children devine, But the llama is numero uno."