GoLang pcntl_signal_get_handler

request it (291)
GoLang replacement for PHP's pcntl_signal_get_handler [edit | history]



Do you know a GoLang replacement for PHP's pcntl_signal_get_handler? Write it!

PHP pcntl_signal_get_handler

PHP original manual for pcntl_signal_get_handler [ show | php.net ]

pcntl_signal_get_handler

(PHP 7 >= 7.1.0)

pcntl_signal_get_handlerGet the current handler for specified signal

Description

mixed pcntl_signal_get_handler ( int $signo )

The pcntl_signal_get_handler() function will get the current handler for the specified signo.

Parameters

signo

The signal number.

Return Values

This function may return an integer value that refers to SIG_DFL or SIG_IGN. If you set a custom handler a string value containing the function name is returned.

Changelog

Version Description
Enter the version of change here Describe the change

Examples

Example #1 pcntl_signal_get_handler() example

<?php
var_dump
(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)

function pcntl_test($signo) {}
pcntl_signal(SIGUSR1'pcntl_test');
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: string(10) "pcntl_test"

pcntl_signal(SIGUSR1SIG_DFL);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(0)

pcntl_signal(SIGUSR1SIG_IGN);
var_dump(pcntl_signal_get_handler(SIGUSR1)); // Outputs: int(1)
?>

See Also