Skip to content

Use sigaction without SA_RESTART instead? #16

Closed
@lilydjwg

Description

@lilydjwg

Currently it uses the signal function which translates to sigaction with the SA_RESTART flag. Most blocking syscalls aren't interrupted by it, e.g. reading from a file descriptor will continue to wait for data after the signal. Setting a running flag won't work unless that read returns and the process can check the running flag.

I encountered this when I was reading inotify events. Ctrl-C didn't stop it until the next event arrived. I'm on Arch Linux x86_64 if it matters.

The change won't be backwards compatible, so perhaps add another feature to opt in?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions