OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / draft / man3 / mkstemp.3
diff --git a/draft/man3/mkstemp.3 b/draft/man3/mkstemp.3
deleted file mode 100644 (file)
index 427e046..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
-.\" and Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com>
-.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" Permission is granted to make and distribute verbatim copies of this
-.\" manual provided the copyright notice and this permission notice are
-.\" preserved on all copies.
-.\"
-.\" Permission is granted to copy and distribute modified versions of this
-.\" manual under the conditions for verbatim copying, provided that the
-.\" entire resulting derived work is distributed under the terms of a
-.\" permission notice identical to this one.
-.\"
-.\" Since the Linux kernel and libraries are constantly changing, this
-.\" manual page may be incorrect or out-of-date.  The author(s) assume no
-.\" responsibility for errors or omissions, or for damages resulting from
-.\" the use of the information contained herein.  The author(s) may not
-.\" have taken the same level of care in the production of this manual,
-.\" which is licensed free of charge, as they might when working
-.\" professionally.
-.\"
-.\" Formatted or processed versions of this manual, if unaccompanied by
-.\" the source, must acknowledge the copyright and authors of this work.
-.\" %%%LICENSE_END
-.\"
-.\" References consulted:
-.\"     Linux libc source code
-.\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
-.\"     386BSD man pages
-.\" Modified Sat Jul 24 18:48:48 1993 by Rik Faith (faith@cs.unc.edu)
-.\" Modified 980310, aeb
-.\" Modified 990328, aeb
-.\" 2008-06-19, mtk, Added mkostemp(); various other changes
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.\"
-.\" Japanese Version Copyright (c) 1997 Kazuyuki Tanisako
-.\"         all rights reserved.
-.\" Translated 1997-05-17, Kazuyuki Tanisako <tanisako@osa.dec-j.co.jp>
-.\" Modified 1997-05-27, Kazuyuki Tanisako <tanisako@osa.dec-j.co.jp>
-.\" Modified 1998-02-05, Kazuyuki Tanisako <tanisako@osa.dec-j.co.jp>
-.\" Modified 1998-09-27, Kazuyuki Tanisako <tanisako@osa.dec-j.co.jp>
-.\" Modified 1999-04-10, Kazuyuki Tanisako <tanisako@osa.dec.com>
-.\" Updated 2001-01-17, Kentaro Shirakata <argrath@ub32.org>
-.\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05
-.\" Updated 2012-04-27, Akihiro MOTOKI <amotoki@gmail.com>
-.\" Updated 2012-05-01, Akihiro MOTOKI <amotoki@gmail.com>
-.\" Updated 2013-03-26, Akihiro MOTOKI <amotoki@gmail.com>
-.\"
-.TH MKSTEMP 3 2014\-08\-19 GNU "Linux Programmer's Manual"
-.SH 名前
-mkstemp, mkostemp, mkstemps, mkostemps \- 他と重ならない名前を持つ一時ファイルを作成する
-.SH 書式
-.nf
-\fB#include <stdlib.h>\fP
-.sp
-\fBint mkstemp(char *\fP\fItemplate\fP\fB);\fP
-.sp
-\fBint mkostemp(char *\fP\fItemplate\fP\fB, int \fP\fIflags\fP\fB);\fP
-.sp
-\fBint mkstemps(char *\fP\fItemplate\fP\fB, int \fP\fIsuffixlen\fP\fB);\fP
-.sp
-\fBint mkostemps(char *\fP\fItemplate\fP\fB, int \fP\fIsuffixlen\fP\fB, int \fP\fIflags\fP\fB);\fP
-.fi
-.sp
-.in -4n
-glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
-.in
-.sp
-\fBmkstemp\fP():
-.ad l
-.RS 4
-.PD 0
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
-.br
-|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200112L
-.PD
-.RE
-.ad b
-.PP
-\fBmkostemp\fP(): _GNU_SOURCE
-.br
-\fBmkstemps\fP(): _BSD_SOURCE || _SVID_SOURCE
-.br
-\fBmkostemps\fP(): _GNU_SOURCE
-.SH 説明
-関数 \fBmkstemp\fP()  は引数 \fItemplate\fP から他と重ならない一時ファイル名を生成し、 そのファイルの作成とオープンを行い、
-そのファイルに対するオープン済みのファイルディスクリプターを返す。
-
-引数 \fItemplate\fP で指示する文字列の後ろの 6 文字は XXXXXX である必要がある。
-この部分がファイル名を他と重ならないようにする文字で置き換えられる。 \fItemplate\fP は書き換えられるため、文字列定数ではなく文字配列として
-宣言するようにしなければならない。
-
-ファイルは許可モード 0600 で作成され、所有者のみが読み書き可能である。返されるファイルディスクリプターで、このファイルへの読み書き両方のアクセスが
-可能である。 呼び出し者がそのファイルを作成するプロセスであることを保証するために、 ファイルは \fBopen\fP(2)  の \fBO_EXCL\fP
-フラグ付きでオープンされる。
-
-.\" Reportedly, FreeBSD
-\fBmkostemp\fP() 関数は \fBmkstemp\fP() と同様だが、 \fIflags\fP に \fBO_APPEND\fP, \fBO_CLOEXEC\fP,
-\fBO_SYNC\fP のビットを指定できる点が異なる (意味は \fBopen\fP(2) と同じである)。ファイルを作成する際、 \fBmkostemp\fP()
-は \fBopen\fP(2) に渡す \fIflags\fP 引き数に \fBO_RDWR\fP, \fBO_CREAT\fP, \fBO_EXCL\fP を含める。そのため、
-\fBmkostemp\fP() に渡す \fIflags\fP 引き数にこれらの値を含める必要はなく、システムによってはエラーが発生する点に注意すること。
-
-\fBmkstemps\fP() 関数は \fBmkstemp\fP() と同様だが、 \fItemplate\fP 内の文字列に長さ
-が \fIsuffixlen\fP 文字の接尾辞 (suffix) が含まれる点が異なる。
-したがって、 \fItemplate\fP は \fIprefixXXXXXXsuffix\fP の形式となる。
-文字列 XXXXXX の部分は \fBmkstemp\fP() により更新される。
-
-\fBmkostemps\fP() と \fBmkstemps\fP() の関係は、
-\fBmkostemp\fP() と \fBmkstemp\fP() の関係と同じである。
-.SH 返り値
-成功すると、これらの関数は一時ファイルのファイルディスクリプターを返す。 エラーの場合は、\-1 を返し、 \fIerrno\fP を適切に設定する。
-.SH エラー
-.TP 
-\fBEEXIST\fP
-すでに同じ名前を持つファイルが存在した。 \fItemplate\fP の内容は不定である。
-.TP 
-\fBEINVAL\fP
-\fBmkstemp\fP() と \fBmkostemp\fP() の場合:
-\fItemplate\fP の最後の 6 文字が XXXXXX でなかった。
-この場合、\fItemplate\fP は変更されない。
-.sp
-\fBmkstemps\fP() と \fBmkostemps\fP() の場合:
-\fItemplate\fP の長さが \fI(6 + suffixlen)\fP 文字より短い、または
-\fItemplate\fP の接尾辞の直前の 6 文字が XXXXXX ではなかった。
-.PP
-これらの関数は \fBopen\fP(2) に書かれているエラーのいずれかで失敗することもある。
-.SH バージョン
-\fBmkostemp\fP() は glibc 2.7 以降で利用できる。
-\fBmkstemps\fP() と \fBmkostemps\fP() は glibc 2.11 以降で利用できる。
-.SH 属性
-.SS "マルチスレッディング (pthreads(7) 参照)"
-関数 \fBmkstemp\fP(), \fBmkostemp\fP(), \fBmkstemps\fP(), \fBmkostemps\fP() はスレッドセーフである。
-.SH 準拠
-\fBmkstemp\fP(): 4.3BSD, POSIX.1\-2001.
-
-.\" mkstemps() appears to be at least on the BSDs, Mac OS X, Solaris,
-.\" and Tru64.
-\fBmkstemps\fP(): 標準化されていないが、他のいくつかのシステムにも存在する。
-
-\fBmkostemp\fP() と \fBmkostemps\fP(): glibc による拡張。
-.SH 注意
-glibc バージョン 2.06 以前では、ファイルは許可モード 0666 で作成され、全てのユーザーが読み書き可能であった。この古い動作は、
-セキュリティ上のリスクになり得る。特に、他の UNIX では許可モードとして 0600
-を使うため、プログラムを移植する際、この細かな違いを見落とす可能性があるからだ。 POSIX.1\-2008 では、ファイルを許可モード 0600
-で作成することが必須要件として追加された。
-
-.\"
-.\" The prototype for
-.\" .BR mktemp ()
-.\" is in
-.\" .I <unistd.h>
-.\" for libc4, libc5, glibc1; glibc2 follows POSIX.1 and has the prototype in
-.\" .IR <stdlib.h> .
-より一般的には、 \fBmkstemp\fP()  の POSIX 規定ではファイルモードについて何も述べていない。 従って、アプリケーションは
-\fBmkstemp\fP()  (や \fBmkostemp\fP())  を呼び出す前にファイルモード生成マスク (\fBumask\fP(2)  参照)
-が適切に設定されているか確認するべきである。
-.SH 関連項目
-\fBmkdtemp\fP(3), \fBmktemp\fP(3), \fBtempnam\fP(3), \fBtmpfile\fP(3), \fBtmpnam\fP(3)
-.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。