Signal

Enum
backed by int

Represents supported POSIX signals exposed by the public API.

Description

This enumeration provides a strongly-typed abstraction over common POSIX signals used for process control and inter-process communication.

Each case MUST map directly to its corresponding POSIX signal number. Consumers MAY use this enum to improve readability and type safety when sending or handling signals.

Implementations interacting with system-level process control SHOULD rely on these values to ensure consistency across environments.

Table of Contents

Cases

Alarm

Alarm clock signal (SIGALRM).

 = \SIGALRM
Child

Child status changed signal (SIGCHLD).

 = \SIGCHLD
Continue

Continue-if-stopped signal (SIGCONT).

 = \SIGCONT
Hangup

Terminal line hangup signal (SIGHUP).

 = \SIGHUP
Interrupt

Interactive interrupt signal (SIGINT).

 = \SIGINT
Kill

Uncatchable termination signal (SIGKILL).

 = \SIGKILL
Pipe

Broken pipe signal (SIGPIPE).

 = \SIGPIPE
Quit

Interactive quit signal (SIGQUIT).

 = \SIGQUIT
Stop

Process stop signal (SIGSTOP).

 = \SIGSTOP
TerminalStop

Terminal stop signal (SIGTSTP).

 = \SIGTSTP
Terminate

Graceful termination signal (SIGTERM).

 = \SIGTERM
User1

User-defined application signal 1 (SIGUSR1).

 = \SIGUSR1
User2

User-defined application signal 2 (SIGUSR2).

 = \SIGUSR2

Methods

exitStatus()

Returns the conventional shell exit status derived from this signal.

 : int
Cases

Cases

Hangup

Case

Terminal line hangup signal (SIGHUP).

Description

This signal is typically sent when a controlling terminal is closed.

Interrupt

Case

Interactive interrupt signal (SIGINT).

Description

This signal is usually triggered by user interaction (e.g., Ctrl+C).

Quit

Case

Interactive quit signal (SIGQUIT).

Description

This signal MAY trigger a core dump depending on the environment.

Kill

Case

Uncatchable termination signal (SIGKILL).

Description

This signal MUST NOT be caught, blocked, or ignored by the process.

User1

Case

User-defined application signal 1 (SIGUSR1).

Description

This signal MAY be used for custom application-level communication.

User2

Case

User-defined application signal 2 (SIGUSR2).

Description

This signal MAY be used for custom application-level communication.

Pipe

Case

Broken pipe signal (SIGPIPE).

Description

This signal is raised when writing to a pipe with no readers.

Alarm

Case

Alarm clock signal (SIGALRM).

Description

This signal is typically used for timer-based interruptions.

Terminate

Case

Graceful termination signal (SIGTERM).

Description

This signal SHOULD be used to request a controlled shutdown.

Child

Case

Child status changed signal (SIGCHLD).

Description

This signal is sent to a parent process when a child process changes state.

Continue

Case

Continue-if-stopped signal (SIGCONT).

Description

This signal resumes a previously stopped process.

Stop

Case

Process stop signal (SIGSTOP).

Description

This signal MUST stop the process and MUST NOT be caught or ignored.

TerminalStop

Case

Terminal stop signal (SIGTSTP).

Description

This signal is typically triggered by user interaction (e.g., Ctrl+Z).

Methods

exitStatus()

Public

Returns the conventional shell exit status derived from this signal.

public exitStatus() : int

Description

According to POSIX conventions, when a process is terminated by a signal, the exit status SHOULD be reported as 128 plus the signal number.

Return values
int

Description

the computed exit status