OSDN Git Service

LDP: Update draft based on the previous commit
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / mktemp.3
1 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 18:48:06 1993 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified Fri Jun 23 01:26:34 1995 by Andries Brouwer (aeb@cwi.nl)
31 .\" (prompted by Scott Burkett <scottb@IntNet.net>)
32 .\" Modified Sun Mar 28 23:44:38 1999 by Andries Brouwer (aeb@cwi.nl)
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" This file was generated with po4a. Translate the source file.
37 .\"
38 .\"*******************************************************************
39 .\"
40 .\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako
41 .\"         all rights reserved.
42 .\" Translated Sat Apr 10 02:12:40 JST 1999
43 .\"         by Kazuyuki Tanisako <tanisako@osa.dec.com>
44 .\"
45 .TH MKTEMP 3 2017\-09\-15 GNU "Linux Programmer's Manual"
46 .SH 名前
47 mktemp \- 他と重ならないテンポラリファイル名を作成する
48 .SH 書式
49 .nf
50 \fB#include <stdlib.h>\fP
51 .PP
52 \fBchar *mktemp(char *\fP\fItemplate\fP\fB);\fP
53 .fi
54 .PP
55 .RS -4
56 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
57 .RE
58 .PP
59 \fBmktemp\fP():
60 .ad l
61 .PD 0
62 .RS 4
63 .TP  4
64 glibc 2.12 以降:
65 (_XOPEN_SOURCE\ >=\ 500) && ! (_POSIX_C_SOURCE\ >=\ 200112L)
66     || /* Glibc since 2.19: */ _DEFAULT_SOURCE
67     || /* Glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
68 .TP 
69 glibc 2.12 より前:
70 .\"    || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
71 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500
72 .RE
73 .PD
74 .ad b
75 .SH 説明
76 \fINever use this function\fP; see BUGS.
77 .PP
78 関数 \fBmktemp\fP()  は引数 \fItemplate\fP から他と重ならない テンポラリファイル名を作成する。引数 \fItemplate\fP
79 で指示する文字配列 の後6文字は XXXXXX である必要がある。この部分がファイル名を他と 重ならないにするような文字で置き換えられる。
80 \fItemplate\fP は書き換えられるため、文字列定数ではなく文字配列として宣言するように しなければならない。
81 .SH 返り値
82 関数 \fBmktemp\fP()  は常に \fItemplate\fP を戻す。 一意な名前が作成された場合、 \fItemplate\fP の最後の 6 バイトに
83 他と重ならない名前 (それまでに出ていない名前) になるような値が格納される。 一意な名前が作成できなかった場合には、 \fItemplate\fP
84 には空文字列がセットされ、 \fIerrno\fP にエラーを示す値がセットされる。
85 .SH エラー
86 .TP 
87 \fBEINVAL\fP
88 引数 \fItemplate\fP で指示された文字列の後6文字が XXXXXX でない。
89 .SH 属性
90 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
91 .TS
92 allbox;
93 lb lb lb
94 l l l.
95 インターフェース        属性  値
96 T{
97 \fBmktemp\fP()
98 T}      Thread safety   MT\-Safe
99 .TE
100 .SH 準拠
101 .\" .SH NOTES
102 .\" The prototype is in
103 .\" .I <unistd.h>
104 .\" for libc4, libc5, glibc1; glibc2 follows the Single UNIX Specification
105 .\" and has the prototype in
106 .\" .IR <stdlib.h> .
107 4.3BSD, POSIX.1\-2001.  POSIX.1\-2008 では \fBmktemp\fP()  の仕様が削除されている。
108 .SH バグ
109 Never use \fBmktemp\fP().  Some implementations follow 4.3BSD and replace
110 XXXXXX by the current process ID and a single letter, so that at most 26
111 different names can be returned.  Since on the one hand the names are easy
112 to guess, and on the other hand there is a race between testing whether the
113 name exists and opening the file, every use of \fBmktemp\fP()  is a security
114 risk.  The race is avoided by \fBmkstemp\fP(3)  and \fBmkdtemp\fP(3).
115 .SH 関連項目
116 \fBmktemp\fP(1), \fBmkdtemp\fP(3), \fBmkstemp\fP(3), \fBtempnam\fP(3), \fBtmpfile\fP(3),
117 \fBtmpnam\fP(3)
118 .SH この文書について
119 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
120 \%https://www.kernel.org/doc/man\-pages/ に書かれている。