perl-5.38.0
kill SIGNAL, LIST
kill SIGNAL

Sends a signal to a list of processes. Returns the number of arguments that were successfully used to signal (which is not necessarily the same as the number of processes actually killed, e.g. where a process group is killed).

プロセスのリストにシグナルを送ります。 シグナル送信に使われた引数の数を返します (例えばプロセスグループが kill された場合のように、実際に kill された プロセスの数と同じとは限りません)。

    my $cnt = kill 'HUP', $child1, $child2;
    kill 'KILL', @goners;

SIGNAL may be either a signal name (a string) or a signal number. A signal name may start with a SIG prefix, thus FOO and SIGFOO refer to the same signal. The string form of SIGNAL is recommended for portability because the same signal may have different numbers in different operating systems.

SIGNAL はシグナル名(文字列)かシグナル番号のどちらかです。 シグナル名は SIG 接頭辞で始まることがあるので、FOOSIGFOO は同じ シグナルを意味します。 移植性から文字列形式の SIGNAL が推奨されます; 同じシグナルが異なった オペレーティングシステムでは異なった番号になることがあるからです。

A list of signal names supported by the current platform can be found in $Config{sig_name}, which is provided by the Config module. See Config for more details.

現在のプラットフォームが対応しているシグナル名の一覧は、Config モジュールによって提供される $Config{sig_name} にあります。 さらなる詳細については Config を参照してください。

A negative signal name is the same as a negative signal number, killing process groups instead of processes. For example, kill '-KILL', $pgrp and kill -9, $pgrp will send SIGKILL to the entire process group specified. That means you usually want to use positive not negative signals.

負のシグナル名は負のシグナル番号と同じで、 プロセスではなくプロセスグループに対して kill を行ないます。 たとえば、kill '-KILL', $pgrpkill -9, $pgrp は指定された プロセスグループ全体に SIGKILL を送ります。 すなわち、通常は、負のシグナルは用いず、正のシグナルを使うことになります。

If SIGNAL is either the number 0 or the string ZERO (or SIGZERO), no signal is sent to the process, but kill checks whether it's possible to send a signal to it (that means, to be brief, that the process is owned by the same user, or we are the super-user). This is useful to check that a child process is still alive (even if only as a zombie) and hasn't changed its UID. See perlport for notes on the portability of this construct.

SIGNAL が数値 0 か文字列 ZERO (または SIGZERO の場合、プロセスに シグナルは送られませんが、kill は、 シグナルを送ることが 可能 かどうかを調べます (これは、簡単に言うと、 プロセスが同じユーザーに所有されているか、自分がスーパーユーザーであることを 意味します)。 これは子プロセスが(ゾンビとしてだけでも)まだ生きていて、 UID が 変わっていないことを調べる時に有用です。 この構成の移植性に関する注意については perlport を参照してください。

The behavior of kill when a PROCESS number is zero or negative depends on the operating system. For example, on POSIX-conforming systems, zero will signal the current process group, -1 will signal all processes, and any other negative PROCESS number will act as a negative signal number and kill the entire process group specified.

PROCESS 番号が 0 あるいは負数の場合の kill の振る舞いは オペレーティングシステムに依存します。 例えば、POSIX 準拠のシステムでは、0 は現在のプロセスグループにシグナルを送り、 -1 は全てのプロセスにシグナルを送り、それ以外の負数の PROCESS 番号は 負数のシグナル番号として動作し、指定されたプロセスグループ全体を kill します。

If both the SIGNAL and the PROCESS are negative, the results are undefined. A warning may be produced in a future version.

SIGNAL と PROCESS の両方が負数の場合、結果は未定義です。 将来のバージョンでは警告が出るかも知れません。

See "Signals" in perlipc for more details.

詳細は "Signals" in perlipc を参照してください。

On some platforms such as Windows where the fork(2) system call is not available, Perl can be built to emulate fork at the interpreter level. This emulation has limitations related to kill that have to be considered, for code running on Windows and in code intended to be portable.

Windows のような fork(2) が利用不能なシステムでは、Perl は fork をインタプリタレベルでエミュレートします。 エミュレーションは kill に関連して、コードが Windows で実行されて しかしコードが移植性があると考えられるように制限があります。

See perlfork for more details.

さらなる詳細については perlfork を参照してください。

If there is no LIST of processes, no signal is sent, and the return value is 0. This form is sometimes used, however, because it causes tainting checks to be run, if your perl support taint checks. But see "Laundering and Detecting Tainted Data" in perlsec.

処理する LIST がない場合、シグナルは送られず、返り値は 0 です。 しかし、この形式は時々使われます; perl が汚染チェックに対応している場合、 実行するために汚染チェックを引き起こすからです。 しかし "Laundering and Detecting Tainted Data" in perlsec を参照してください。

Portability issues: "kill" in perlport.

移植性の問題: "kill" in perlport