GETTTYENT

Section: Linux Programmer's Manual (3)
Updated: 2017-09-15
Index JM Home Page
 

名前

getttyent, getttynam, setttyent, endttyent - ttys ファイルのエントリーを取得する  

書式

#include <ttyent.h>

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 でのログインを許可する */  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース 属性
getttyent(), setttyent(), endttyent(), getttynam() Thread safety MT-Unsafe race:ttyent
 

準拠

POSIX.1 にはない。 BSD 系に存在し、おそらく他のシステムにもあるだろう。  

注意

Linux では、ファイル /etc/ttys と上で説明した関数は使われていない。  

関連項目

ttyname(3), ttyslot(3)  

この文書について

この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。

関連キーワード

関数, ttyent, GETTTYENT, オープン, getttyent, getttynam, setttyent, endttyent, 属性, getty

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
属性
準拠
注意
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:46 GMT, June 11, 2022