Coder Social home page Coder Social logo

Comments (6)

HertzDevil avatar HertzDevil commented on June 25, 2024 1

It looks like none of the bindings define LibC::SA_RESTART, so maybe it's best to use sigaction there only when {{ flag?(:solaris) }} is true, unless someone could find the correct values on all supported systems?

from crystal.

ysbaddaden avatar ysbaddaden commented on June 25, 2024

@straight-shoota @HertzDevil the solaris PR changes the signal handler to use sigaction(2) instead of signal(2) and we get interrupted syscalls 🤔

https://github.com/crystal-lang/crystal/pull/14343/files#diff-defc0d953337c02ce30da590dbf3a9f0daa536c9fae6ad381e2af06ffab1eb60

from crystal.

ysbaddaden avatar ysbaddaden commented on June 25, 2024

Reading the signal(7) man page, we might just need to add the SA_RESTART flag?

from crystal.

ysbaddaden avatar ysbaddaden commented on June 25, 2024

From the signal(2) man page:

The situation on Linux is as follows:

  • The kernel's signal() system call provides System V semantics.
  • By default, in glibc 2 and later, the signal() wrapper function does not invoke the kernel system call. Instead, it calls sigaction(2) using flags that supply BSD semantics.

The BSD semantics are equivalent to calling sigaction(2) with the following flags:

sa.sa_flags = SA_RESTART;

from crystal.

ysbaddaden avatar ysbaddaden commented on June 25, 2024

I pushed without checking 🤦

Luckily, I have a copy of many /usr/include on my computer from when I wrote the posix shard. They date from many years back, but constants for syscalls are unlikely to ever change.

That being said, I wish I could just say "I want SA_RESTART please figure its actual value".

from crystal.

straight-shoota avatar straight-shoota commented on June 25, 2024

but constants for syscalls are unlikely to ever change.

Yeah, that would lead to very surprising results 😆

from crystal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.