git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] xread/xwrite: do not worry about EINTR at calling sites.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 20, 2005, 10:40 UTC
Message-ID
<Pine.LNX.4.63.0512201136430.29711@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vvexkpoxf.fsf_-_@assigned-by-dhcp.cox.net>
Hi,
On Mon, 19 Dec 2005, Junio C Hamano wrote:
Show 10 quoted lines
> +static inline ssize_t xwrite(int fd, const void *buf, size_t len)
> +{
> +	ssize_t nr;
> +	while (1) {
> +		nr = write(fd, buf, len);
> +		if ((nr < 0) && (errno == EAGAIN || errno == EINTR))
> +			continue;
> +		return nr;
> +	}
> +}

In another project I'm working on, a user insisted that on Solaris 2.7, write(2) sometimes returns ENOENT when it really means "try again". I cannot verify, since I don't have Solaris 2.7.

Ciao, Dscho

Previous: Junio C HamanoNext: Linus Torvalds
Message 5 of 6 in “EAGAIN?”
  1. Junio C HamanoDec 19, 2005
  2. Linus TorvaldsDec 19, 2005
  3. H. Peter AnvinDec 19, 2005
  4. xread/xwrite: do not worry about EINTR at calling sites.Junio C Hamano, Dec 20, 2005
  5. Johannes SchindelinDec 20, 2005
  6. Linus TorvaldsDec 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.