posix_getsid

(PHP 4, PHP 5, PHP 7, PHP 8)

posix_getsidプロセスの現在の sid を得る

説明

posix_getsid(int $process_id): int|false

プロセス process_id のセッション ID を返します。 プロセスのセッション ID とは、セッションリーダーのプロセスグループ ID のことです。

パラメータ

process_id

プロセス ID。0 を指定すると、現在のプロセスとみなされます。 不正な process_id を指定すると、 false が返され、 posix_get_last_error() でチェックできるエラー情報が設定されます。

戻り値

ID を表す整数値を返します。 失敗した場合に false を返します

例1 posix_getsid() の使用例

<?php
$pid
= posix_getpid();
echo
posix_getsid($pid); /8805
?>

参考

  • posix_getpgid() - ジョブ制御のプロセスグループ ID を得る
  • posix_setsid() - 現在のプロセスをセッションリーダーにする
  • POSIX man ページ GETSID(2)

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant