[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] [PATCH] x86_64: fix mincore_validate and msync_val
From: |
Dave Watson |
Subject: |
Re: [Libunwind-devel] [PATCH] x86_64: fix mincore_validate and msync_validate |
Date: |
Fri, 18 Aug 2017 09:54:42 -0700 |
User-agent: |
Mutt/1.6.0 (2016-04-01) |
On 08/18/17 09:46 AM, Paul Pluzhnikov wrote:
> On Fri, Aug 18, 2017 at 8:16 AM, Dave Watson <address@hidden> wrote:
>
> > and also handle EINTR
>
> > + int bytes = read (validate_pipe[0], &buf, 1);
> > + if (bytes >= 0 || errno == EAGAIN || errno == EWOULDBLOCK)
>
> On Linux:
>
> #define EWOULDBLOCK EAGAIN /* Operation would block */
>
> Did you mean errno == EINTR above?
No, EINTR should retry again in the loop. I just went by the manpage that
claims
EAGAIN or EWOULDBLOCK
The file descriptor fd refers to a socket and has been marked nonblocking
(O_NONBLOCK), and the read would
block. POSIX.1-2001 allows either error to be returned for this case,
and does not require these constants to
have the same value, so a portable application should check for both
possibilities.