Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

pcntl_sigprocmask

Description

The pcntl_sigprocmask of PCNTL for PHP sets and retrieves blocked signals.

Syntax

pcntl_sigprocmask(
    int $mode,
    array $signals,
    array &$old_signals = null
): bool

Parameters

mode

Sets the behavior.

ConstantDescription
SIG_BLOCKAdd the signals to the currently blocked signals.
SIG_UNBLOCKRemove the signals from the currently blocked signals.
SIG_SETMASKReplace the currently blocked signals by the given list of signals.

signals

The list of signals.

old_signals

The list of the previously blocked signals.

Return

Returns true on success or false on failure.

Examples

1 · mode · SIG_BLOCK · signals

<?

$mode = SIG_BLOCK;
$signals =
[
    SIGHUP
];

$return = pcntl_sigprocmask($mode, $signals);

var_export($return);

?>
true

2 · mode · SIG_UNBLOCK · signals

<?

$mode = SIG_UNBLOCK;
$signals =
[
    SIGHUP
];

$return = pcntl_sigprocmask($mode, $signals);

var_export($return);

?>
true

3 · mode · SIG_SETMASK · signals

<?

$mode = SIG_SETMASK;
$signals =
[
    SIGHUP
];

$return = pcntl_sigprocmask($mode, $signals);

var_export($return);

?>
true

4 · old_signals

<?

$mode = SIG_BLOCK;
$signals =
[
    SIGHUP
];

$return = pcntl_sigprocmask($mode, $signals, $old_signals);

var_export($return);
echo PHP_EOL;
print_r($old_signals);

?>
true
Array
(
    [0] => 1
)
HomeMenu