Date: Sun, 25 Jan 1998 12:52:12 -0200 (EDT) From: "Daniel C. Sobral" <dcs@gns.com.br> To: hackers@FreeBSD.ORG Subject: uiomove() Message-ID: <199801251452.MAA00740@daniel.sobral> In-Reply-To: <199801241656.IAA24947@hub.freebsd.org> from freebsd-hackers-digest at "Jan 24, 98 08:56:16 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> 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."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801251452.MAA00740>