CakeFest 2024: The Official CakePHP Conference

POSIX 関数

参考

プロセス制御関数に関する節も 役に立つでしょう。

目次

  • posix_access — ファイルのアクセス権限を判断する
  • posix_ctermid — 制御する端末のパス名を得る
  • posix_eaccess — ファイルがアクセスできるかを調べる
  • posix_errno — posix_get_last_error のエイリアス
  • posix_fpathconf — 設定可能なリミットの値を返す
  • posix_get_last_error — 直近で失敗した posix 関数が設定したエラー番号を取得する
  • posix_getcwd — 現在のディレクトリのパス名
  • posix_getegid — 現在のプロセスの有効なグループ ID を返す
  • posix_geteuid — 現在のプロセスの有効なユーザー ID を返す
  • posix_getgid — 現在のプロセスの実際のグループ ID を返す
  • posix_getgrgid — 指定したグループ ID を有するグループに関する情報を返す
  • posix_getgrnam — 指定した名前のグループに関する情報を返す
  • posix_getgroups — 現在のプロセスのグループセットを返す
  • posix_getlogin — ログイン名を返す
  • posix_getpgid — ジョブ制御のプロセスグループ ID を得る
  • posix_getpgrp — 現在のプロセスのグループ ID を返す
  • posix_getpid — 現在のプロセス ID を返す
  • posix_getppid — 親プロセスの ID を返す
  • posix_getpwnam — 指定した名前のユーザーに関する情報を返す
  • posix_getpwuid — 指定 ID のユーザーに関する情報を返す
  • posix_getrlimit — システムリソース制限に関する情報を返す
  • posix_getsid — プロセスの現在の sid を得る
  • posix_getuid — 現在のプロセスの実際のユーザー ID を返す
  • posix_initgroups — グループアクセスリストを求める
  • posix_isatty — ファイル記述子が対話型端末であるかどうかを定義する
  • posix_kill — プロセスにシグナルを送信する
  • posix_mkfifo — fifo スペシャルファイル(名前付きパイプ)を作成する
  • posix_mknod — スペシャルファイルあるいは通常のファイルを作成する (POSIX.1)
  • posix_pathconf — 設定可能なリミットの値を返す
  • posix_setegid — 現在のプロセスの実効 GID を設定する
  • posix_seteuid — 現在のプロセスの実効 UID を設定する
  • posix_setgid — 現在のプロセスの GID を設定する
  • posix_setpgid — ジョブ制御のプロセスグループ ID を設定する
  • posix_setrlimit — システムリソース制限を設定
  • posix_setsid — 現在のプロセスをセッションリーダーにする
  • posix_setuid — 現在のプロセスの UID を設定する
  • posix_strerror — 指定したエラー番号に対応するシステムのエラーメッセージを取得する
  • posix_sysconf — システムの実行時情報を返す
  • posix_times — プロセス時間を得る
  • posix_ttyname — 端末のデバイス名を調べる
  • posix_uname — システム名を得る
add a note

User Contributed Notes 2 notes

up
11
random832 at fastmail dot fm
16 years ago
That is not part of POSIX, those are only present as you listed on linux systems - some other systems have a /proc with different things in it (sometimes stuff that's symbolic links on linux will be hardlinks, textfiles on linux will be binary, or different files with different information) or none at all
up
-4
roberto at spadim dot com dot br
17 years ago
don't forget that in posix systems you can use /proc/$process_id/
files:
auxv
cmdline
cwd
environ
exe
fd
maps
mem
mounts
root
stat
statm
status
task
wchan

with it you can make somethings like:

$PPID=getmypid();
$pid=pcntl_fork();
if ($pid==0){
while(1){
if (strpos(file_get_contents("/proc/$PPID/cmdline"),'php')===false) echo "parent pid die";
}

}else{
// forked
}

with this you can use some libs that block signal or some bad signal handling or zombies process or anything you can think :)
To Top