Skip to content

Mechanism to query existing signal handler #2172

Open
@cpick

Description

@cpick

If NULL is passed as the second (new action) argument to sigaction(), then it won't make any changes, but will return the existing action.

I don't believe nix provides any way to access this behavior. The type of nix::sys::signal::sigaction()s sigaction argument could be changed from &SigAction to Option<&SigAction>, but this would be a breaking change and also would mean doing a read-only query of the current action would only be possible with an unsafe function call.

I'd prefer something like a safe sigaction_get() (roughly akin to this proposal for a sigaction_safe()).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions