getttyent
1. getttyent.3.man
Manpage of GETTTYENT
GETTTYENT
Section: Linux Programmer's Manual (3)Updated: 2002-07-18
Index Return to Main Contents
名前
getttyent, getttynam, setttyent, endttyent - ttys ファイルのエントリを取得する書式
#include <ttyent.h>struct ttyent *getttyent(void);
struct ttyent *getttynam(const char *name);
int setttyent(void);
説明
これらの関数はファイル _PATH_TTYS (例えば /etc/ttys) へのインタフェースを提供する。関数 setttyent() はファイルをオープンする。 また既にオープンされている場合は、巻き戻す。
関数 endttyent() はファイルをクローズする。
関数 getttynam() は指定された端末名についてファイルを検索する。 この関数は (以下で説明されている) ttyent 構造体へのポインタを返す。
関数 getttyent() は (もし必要であれば) ファイル _PATH_TTYS をオープンし、最初のエントリを返す。 ファイルが既にオープンされている場合は、次のエントリを返す。 ttyent 構造体は以下の通りである。
struct ttyent {
char *ty_name; /* 端末デバイス名 */
char *ty_getty; /* 実行するコマンド。通常は getty */
char *ty_type; /* termcap のための端末タイプ */
int ty_status; /* 状態フラグ */
char *ty_window; /* ウィンドウマネージャを起動するコマンド */
char *ty_comment; /* コメントフィールド */
};
ty_status
は以下のいずれか値をとることができる。
#define TTY_ON 0x01 /* ログインを有効にする (ty_getty プログラムを開始する) */ #define TTY_SECURE 0x02 /* ユーザ ID 0 でのログインを許可する */
準拠
POSIX.1-2001 にはない。 BSD 系に存在し、おそらく他のシステムにもあるだろう。注意
Linux では、ファイル /etc/ttys と上で説明した関数は使われていない。関連項目
ttyname(3), ttyslot(3)
Index
This document was created by man2html using the manual pages.
Time: 17:38:43 GMT, May 11, 2012


