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