OSDN Git Service

(split) LDP: Update release (3.64)
[linuxjm/LDP_man-pages.git] / release / man3 / gets.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Wed Jul 28 11:12:07 1993 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Fri Sep  8 15:48:13 1995 by Andries Brouwer (aeb@cwi.nl)
27 .\" Modified 2013-12-31, David Malcolm <dmalcolm@redhat.com>
28 .\"     Split gets(3) into its own page; fgetc() et al. move to fgetc(3)
29 .\"*******************************************************************
30 .\"
31 .\" This file was generated with po4a. Translate the source file.
32 .\"
33 .\"*******************************************************************
34 .\"
35 .\" Japanese Version Copyright (c) 1997 IMAMURA Nobutaka
36 .\"         all rights reserved.
37 .\" Translated 1997-02-14, IMAMURA Nobutaka <imamura@spp.hpc.fujitsu.co.jp>
38 .\" Updated 1999-08-29, Kentaro Shirakata <argrath@ub32.org>
39 .\" Updated 2001-11-02, Kentaro Shirakata <argrath@ub32.org>
40 .\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
41 .\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
42 .\"
43 .TH GETS 3 2014\-01\-24 GNU "Linux Programmer's Manual"
44 .SH 名前
45 gets \- 標準入力からの文字列を取得する (非推奨)
46 .SH 書式
47 .nf
48 \fB#include <stdio.h>\fP
49 .sp
50 \fBchar *gets(char *\fP\fIs\fP\fB);\fP
51 .fi
52 .SH 説明
53 \fIこの関数は使用しないこと\fP。
54
55 \fBgets\fP()  は、改行文字か \fBEOF\fP までの 1行を \fIstdin\fP から読み込み \fIs\fP が指すバッファに格納する
56 (末尾の改行文字や \fBEOF\fP は NULL バイト (\(aq\e0\(aq) に置き換えられる)。 バッファオーバーランのチェックは行われない
57 (下記の「バグ」を参照)。
58 .SH 返り値
59 \fBgets\fP()  returns \fIs\fP on success, and NULL on error or when end of file
60 occurs while no characters have been read.  However, given the lack of
61 buffer overrun checking, there can be no guarantees that the function will
62 even return.
63 .SH 準拠
64 C89, C99, POSIX.1\-2001.
65
66 LSB は \fBgets\fP() を非推奨としている。
67 POSIX.1\-2008 では \fBgets\fP() に廃止予定の印が付けられている。
68 ISO C11 では \fBgets\fP)() の規定が C 言語から削除されている。
69 glibc バージョン 2.16 以降では、機能検査マシン \fB_ISOC11_SOURCE\fP が定義された
70 場合、glibc ヘッダファイルでは \fBgets\fP)() の宣言が公開されない。
71 .SH バグ
72 \fBgets\fP()  は絶対に使用してはならない。 前もってデータを知ることなしに \fBgets\fP()  が何文字読むかを知ることはできず、
73 \fBgets\fP()  がバッファの終わりを越えて書き込み続けるため、 \fBgets\fP()  を使うのは極めて危険である。
74 これを利用してコンピュータのセキュリティが破られてきた。 代わりに \fBfgets\fP()  を使うこと。
75
76 For more information, see CWE\-242 (aka "Use of Inherently Dangerous
77 Function") at http://cwe.mitre.org/data/definitions/242.html
78 .SH 関連項目
79 \fBread\fP(2), \fBwrite\fP(2), \fBferror\fP(3), \fBfgetc\fP(3), \fBfgets\fP(3),
80 \fBfgetwc\fP(3), \fBfgetws\fP(3), \fBfopen\fP(3), \fBfread\fP(3), \fBfseek\fP(3),
81 \fBgetline\fP(3), \fBgetwchar\fP(3), \fBputs\fP(3), \fBscanf\fP(3), \fBungetwc\fP(3),
82 \fBunlocked_stdio\fP(3), \fBfeature_test_macros\fP(7)
83 .SH この文書について
84 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.64 の一部
85 である。プロジェクトの説明とバグ報告に関する情報は
86 http://www.kernel.org/doc/man\-pages/ に書かれている。