Skip to content

os/signal: Prevent developers from catching SIGKILL and SIGSTOP #9463

@tobegit3hub

Description

@tobegit3hub

Refer to https://en.wikipedia.org/wiki/Unix_signal#SIGKILL, we know that SIGKILL and SIGSTOP can't be caught or ignored. So golang should prevent developers from trying to do that.

Now the following code is possible to compile but totally invalid.

c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGKILL, syscall.SIGSTOP)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions