Thread overview
[Issue 17296] EINTR awareness - posix system calls can be interrupted by posix signal
Apr 05, 2017
Roman
Dec 17, 2022
Iain Buclaw
April 05, 2017
https://issues.dlang.org/show_bug.cgi?id=17296

--- Comment #1 from Roman <freeslave93@gmail.com> ---
It turned out that the problem can appear even if user does not do signal handling himself. It's enough to just do multithreading, so signals used by GC can interrupt syscall in other thread.

Whether the hack is applied or not, the behavior of functions will need to be documented. If hack is applied, it should say about possible looping, if it's not applied it should say that interruption is considered error for these functions.

There's also updated version of the hack:

template deintr(alias func)
if (isFunction!func && isIntegral!(ReturnType!func) &&
    isSigned!(ReturnType!func) && functionLinkage!func == "C")
{
    ReturnType!func deintr(Args...)(Parameters!func args, Args varArgs)
    {
        ReturnType!func result;
        do
        {
            result = func(args, varArgs);
        }
        while(result == -1 && .errno == EINTR);
        return result;
    }
}

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=17296

greensunny12@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #2 from greensunny12@gmail.com ---
First PR pull: https://github.com/dlang/phobos/pull/5503

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=17296

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--