getttyentのヘルプ・マニュアル
日本語 英語
getttyent --help
man getttyent
GETTTYENT(3) Linux Programmer’s Manual GETTTYENT(3)
名前
getttyent, getttynam, setttyent, endttyent - ttys ファイルのエントリを
取得する
書式
#include
struct ttyent *getttyent(void);
struct ttyent *getttynam(const char *name);
int setttyent(void);
int endttyent(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)
GNU 2002-07-18 GETTTYENT(3)
GETTTYENT(3) Linux Programmer’s Manual GETTTYENT(3)
NAME
getttyent, getttynam, setttyent, endttyent - get ttys file entry
SYNOPSIS
#include
struct ttyent *getttyent(void);
struct ttyent *getttynam(const char *name);
int setttyent(void);
int endttyent(void);
DESCRIPTION
These functions provide an interface to the file _PATH_TTYS (e.g.,
/etc/ttys).
The function setttyent() opens the file or rewinds it if already open.
The function endttyent() closes the file.
The function getttynam() searches for a given ttyname in the file. It
returns a pointer to a ttyent structure (description below).
The function getttyent() opens the file _PATH_TTYS (if necessary) and
returns the first entry. If the file is already open, the next entry.
The ttyent structure has the form:
struct ttyent {
char *ty_name; /* terminal device name */
char *ty_getty; /* command to execute, usually getty */
char *ty_type; /* terminal type for termcap */
int ty_status; /* status flags */
char *ty_window; /* command to start up window manager */
char *ty_comment; /* comment field */
};
ty_status can be:
#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
#define TTY_SECURE 0x02 /* allow UID 0 to login */
CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs, and perhaps other systems.
NOTES
Under Linux the file /etc/ttys, and the functions described above, are
not used.
SEE ALSO
ttyname(3), ttyslot(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2002-07-18 GETTTYENT(3)