bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13018: fport_fill_input should handle EINTR


From: Andy Wingo
Subject: bug#13018: fport_fill_input should handle EINTR
Date: Wed, 13 Mar 2013 12:44:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

On Thu 29 Nov 2012 21:19, address@hidden (Ludovic Courtès) writes:

> Aidan Gauland <address@hidden> skribis:
>
>> <mark_weaver> fport_fill_input should handle an EINTR error from 'read',
>>               and restart the read if that happens.
>>
>> <mark_weaver> by default on some systems, signals cause 'read', 'write',
>>               and many other system calls to abort and return an EINTR
>>               error.
>>
>> <mark_weaver> basically, at the POSIX level, every call to 'read' has to
>>               be within a little loop that takes care of the EINTR
>>               problem.
>
> ‘fport_fill_input’ does this:
>
>   SCM_SYSCALL (count = read (fp->fdes, pt->read_buf, pt->read_buf_size));
>
> and SCM_SYSCALL does that:
>
>   # ifdef EINTR
>   #  if (EINTR > 0)
>   #   define SCM_SYSCALL(line)                    \
>     do                                            \
>       {                                           \
>         errno = 0;                                \
>         line;                                     \
>         if (errno == EINTR)                       \
>           {                                       \
>             SCM_ASYNC_TICK;                       \
>             continue;                             \
>           }                                       \
>       }                                           \
>     while(0)
>   #  endif /*  (EINTR > 0) */
>   # endif /* def EINTR */

I get the feeling the EINTR is coming from somewhere else -- like the
ASYNC_TICK.  The sigaction could cause a thunk to run there.

Aidan, do you have a test case?

Andy
-- 
http://wingolog.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]