Antoine Pitrou added the comment:

> FWIW, there are times when we *want* the interrupted system call to
> return control to Python rather than retrying the call.

I'm a bit curious, do you know of any use cases?

> If someone is making a Python equivalent of the low level system call
> such as select() or poll(), the EINTR should be exposed for Python
> code to handle.

As mentioned in another issue, you would use a special wakeup fd to
wakeup select() or poll() calls.

> Getting an EINTR errno does *not* mean you can simply retry the system
> calls with the exact same arguments.  ie: If you did that with the
> select() call within time.sleep it'd be trivial to make the process
> sleep forever by sending it signals with a frequency less than the
> sleep time.

Indeed. That's already done in e.g. socketmodule.c : take a look at the
BEGIN_SELECT_LOOP / END_SELECT_LOOP macros.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to