File: getttyent.3

package info (click to toggle)
manpages-ja 0.5.0.0.20210215%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 28,568 kB
  • sloc: perl: 161; makefile: 58
file content (80 lines) | stat: -rw-r--r-- 3,515 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
.\"
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
.\" Distributed under GPL
.\" %%%LICENSE_END
.\"
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.\"
.\" Japanese Version Copyright (c) 2004 Yuichi SATO
.\"         all rights reserved.
.\" Translated Fri Aug 20 03:27:22 JST 2004
.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
.\"
.TH GETTTYENT 3 2013\-07\-22 GNU "Linux Programmer's Manual"
.SH 名前
getttyent, getttynam, setttyent, endttyent \- ttys ファイルのエントリーを取得する
.SH 書式
\fB#include <ttyent.h>\fP
.sp
\fBstruct ttyent *getttyent(void);\fP
.sp
\fBstruct ttyent *getttynam(const char *\fP\fIname\fP\fB);\fP
.sp
\fBint setttyent(void);\fP
.sp
\fBint endttyent(void);\fP
.SH 説明
これらの関数はファイル \fB_PATH_TTYS\fP (例えば \fI/etc/ttys\fP)  へのインターフェースを提供する。

関数 \fBsetttyent\fP()  はファイルをオープンする。 また既にオープンされている場合は、巻き戻す。

関数 \fBendttyent\fP()  はファイルをクローズする。

関数 \fBgetttynam\fP()  は指定された端末名についてファイルを検索する。 この関数は (以下で説明されている)  \fIttyent\fP
構造体へのポインターを返す。

関数 \fBgetttyent\fP()  は (もし必要であれば) ファイル \fB_PATH_TTYS\fP をオープンし、最初のエントリーを返す。
ファイルが既にオープンされている場合は、次のエントリーを返す。 \fIttyent\fP 構造体は以下の通りである。
.in +4n
.nf

struct ttyent {
    char *ty_name;     /* 端末デバイス名 */
    char *ty_getty;    /* 実行するコマンド。通常は getty */
    char *ty_type;     /* termcap のための端末タイプ */
    int   ty_status;   /* 状態フラグ */
    char *ty_window;   /* ウィンドウマネージャを起動するコマンド */
    char *ty_comment;  /* コメントフィールド */
};
.fi
.in

\fIty_status\fP は以下のいずれか値をとることができる。
.br
.nf

#define TTY_ON     0x01  /* ログインを有効にする (ty_getty プログラムを開始する) */
#define TTY_SECURE 0x02  /* ユーザー ID 0 でのログインを許可する */
.fi
.SH 属性
.SS "マルチスレッディング (pthreads(7) 参照)"
関数 \fBgetttyent\fP() は静的変数へのポインターを返す。そのため、スレッドセーフではない。
.LP
関数 \fBsetttyent\fP() と \fBendttyent\fP() は静的変数を使用する。そのため、スレッドセーフではない。
.LP
関数 \fBgetttynam\fP() はスレッドセーフではない関数 \fBgetttyent\fP() を呼び出す。そのため、スレッドセーフではない。
.SH 準拠
POSIX.1\-2001 にはない。 BSD 系に存在し、おそらく他のシステムにもあるだろう。
.SH 注意
Linux では、ファイル \fI/etc/ttys\fP と上で説明した関数は使われていない。
.SH 関連項目
\fBttyname\fP(3), \fBttyslot\fP(3)
.SH この文書について
この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。