posix_getpgid() returns NULL if the given pid doesn't exist and can therefore be used to determine if a particular pid refers to an existing process. Beware, however, that pids are recycled so this method can result in false positives.
posix_getpgid
(PHP 4, PHP 5)
posix_getpgid — ジョブ制御のプロセスグループ ID を得る
説明
int posix_getpgid
( int $pid
)
プロセス pid のプロセスグループ ID を返します。
パラメータ
- pid
-
プロセス ID。
返り値
ID を表す整数値を返します。
例
例1 posix_getpgid() の使用例
<?php
$pid = posix_getppid();
echo posix_getpgid($pid); //35
?>
注意
注意: この関数は POSIX 関数ではなく、BSD および System V のシステムで共通な関数です。 使用するシステムがこの関数をサポートしていない場合は、 PHP のコンパイル時にこの関数は組み込まれません。 この関数が使用可能かどうかを調べるには、function_exists() を使用します。
posix_getpgid
bozo_z_clown at yahoo dot com
03-Feb-2008 12:07
03-Feb-2008 12:07
