tail head cat sleep
QR code linking to this page

manページ  — CTERMID

名称

ctermid – 端末パス名を生成する

内容

ライブラリ

Standard C Library (libc, -lc)

書式

#include <stdio.h>

char *
ctermid(char *buf);

char *
ctermid_r(char *buf);

解説

ctermid() 関数は、パス名として使用されたときに、呼び出し元プロセスの現在の 制御端末を参照する文字列を生成します。

buf NULL ポインタの場合、静的領域を指すポインタが返されます。 そうでない場合は、パス名が、 buf で参照されるメモリにコピーされます。 引数 buf は、長さが少なくとも L_ctermid (インクルードファイル < stdio.h> に定義) バイトと仮定されます。

ctermid_r() は、 buf NULL ポインタであった場合に NULL を返すこと以外は、 ctermid() と同じ機能を提供します。

現在の実装では単に ‘/dev/tty’ を返します。

戻り値

処理が成功すると、 NULL でないポインタが返されます。 処理が失敗すると、 NULL ポインタが返され、グローバル変数 errno がエラーを示すように設定されます。

エラー

現在の実装では、検出されるエラー条件はありません。

関連項目

ttyname(3)

規格

ctermid() 関数は、 IEEE Std 1003.1-88 ("POSIX.1") に適合しています。

バグ

デフォルトでは、 ctermid() 関数は、すべての情報を内部の静的オブジェクトに書き込みます。 後で ctermid() を呼ぶと、同じオブジェクトが修正されます。

CTERMID (3) June 4, 1993

tail head cat sleep
QR code linking to this page


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

Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology.
— The Unix Haters' handbook