tail head cat sleep
QR code linking to this page

manページ  — GETPID

名称

getpid, getppid – 親または呼び出しプロセスの識別子を取得

内容

ライブラリ

Standard C Library (libc, -lc)

書式

#include <sys/types.h>
#include <unistd.h>

pid_t
getpid(void);

pid_t
getppid(void);

解説

getpid() システムコールは呼び出しプロセスのプロセス ID を返します。 ID はユニークであることが保証されていますが、 テンポラリファイル名の作成に利用しては いけません。 セキュリティ上の理由については、 mkstemp(3) を参照してください。

getppid() システムコールは呼び出しプロセスの親のプロセス ID を返します。

エラー

getpid() システムコールと getppid() システムコールは必ず正常に完了するので、エラーを示すための戻り値はありません。

関連項目

gethostid(3)

規格

getpid() システムコールと getppid() システムコールは IEEE Std 1003.1-90 ("POSIX.1") に適合しています。

歴史

getpid() 関数は AT&T v7 で登場しました。

GETPID (2) June 4, 1993

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
— Maurice Wilkes