# Ruby and interrupted system calls (EINTR)

**URL:** <https://rubytalk.org/t/ruby-and-interrupted-system-calls-eintr/75504>\
**Category:** ruby-talk\
**Created:** [21 June 2021 10:29 UTC](https://rubytalk.org/t/ruby-and-interrupted-system-calls-eintr/75504 "2021-06-21T10:29:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivo\_Anjo](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/ivo_anjo/32/2367_2.png) [@Ivo\_Anjo](https://rubytalk.org/u/Ivo_Anjo)\
**Post date:** [21 June 2021 10:29 UTC](https://rubytalk.org/t/ruby-and-interrupted-system-calls-eintr/75504/1 "2021-06-21T10:29:13Z")

</div>

Hello there!

I'm currently researching how "safe" the Ruby ecosystem (apps, gems, VM)  
are regarding sending signals to the Ruby VM which can cause system calls  
to be interrupted and return EINTR.

A few years ago in Python there was an effort to make sure the default  
wrappers provided by Python did the "right thing" automatically when a  
system call returns EINTR: [PEP 475 -- Retry system calls failing with EINTR | Python.org](https://www.python.org/dev/peps/pep-0475/) .

I've been looking at the Ruby sources and there are quite a few places  
where EINTR is handled, but not a lot of documentation around if the VM is  
usually expected to handle this in all cases OR if it's a case-by-case  
thing and user libraries need to be modified to catch all the EINTRs that  
Ruby doesn't handle.

I thought I'd try my luck and try posting to this list and ask if anyone  
had some hints on this matter of EINTR handling 🙂

Thanks, and have an awesome day, y'all.  
-- Ivo Anjo
