OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / tmpfile.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 17:46:57 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2001-11-17, aeb
29 .\"
30 .\" Japanese Version Copyright (c) 1997 Tenkou N. Hattori
31 .\"       all rights reserved.
32 .\" Translated Sat Jan 18 16:51:59 JST 1997
33 .\"     by Tenkou N. Hattori <tnh@alpsmap.co.jp>
34 .\" Updated & Modified Sun Dec  9 15:25:20 JST 2001
35 .\"     by Yuichi SATO <ysato@h4.dion.ne.jp>
36 .\"
37 .TH TMPFILE 3  2008-07-14 "" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .SH Ì¾Á°
40 .\"O tmpfile \- create a temporary file
41 tmpfile \- ¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë
42 .\"O .SH SYNOPSIS
43 .SH ½ñ¼°
44 .nf
45 .B #include <stdio.h>
46 .sp
47 .B FILE *tmpfile(void);
48 .fi
49 .\"O .SH DESCRIPTION
50 .SH ÀâÌÀ
51 .\"O The
52 .\"O .BR tmpfile ()
53 .\"O function opens a unique temporary file
54 .\"O in binary read/write (w+b) mode.
55 .\"O The file will be automatically deleted when it is closed or the
56 .\"O program terminates.
57 .BR tmpfile ()
58 ´Ø¿ô¤Ï¥æ¥Ë¡¼¥¯¤Ê¥Æ¥ó¥Ý¥é¥ê¥Õ¥¡¥¤¥ë¤ò
59 ¥Ð¥¤¥Ê¥ê¥ê¡¼¥É¥é¥¤¥È¥â¡¼¥É (w+b) ¤Ç¥ª¡¼¥×¥ó¤¹¤ë¡£
60 ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥¯¥í¡¼¥º»þ¤Þ¤¿¤Ï¥×¥í¥°¥é¥à¤Î½ªÎ»»þ¤Ë¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¡£
61 .\"O .SH "RETURN VALUE"
62 .SH ÊÖ¤êÃÍ
63 .\"O The
64 .\"O .BR tmpfile ()
65 .\"O function returns a stream descriptor, or NULL if
66 .\"O a unique filename cannot be generated or the unique file cannot be
67 .\"O opened.
68 .\"O In the latter case, \fIerrno\fP is set to indicate the error.
69 .BR tmpfile ()
70 ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¤«¡¢
71 ¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë¤¬ºî¤ì¤Ê¤«¤Ã¤¿¤«¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
72 ¸å¼Ô¤Î¾ì¹ç¡¢¥¨¥é¡¼¤òɽ¤¹ \fIerrno\fP ¤òÀßÄꤹ¤ë¡£
73 .\"O .SH ERRORS
74 .SH ¥¨¥é¡¼
75 .TP
76 .B EACCES
77 .\"O Search permission denied for directory in file's path prefix.
78 ¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥µ¡¼¥Á¤Î¥¢¥¯¥»¥¹¸¢ (search permission) ¤¬¤Ê¤¤¡£
79 .TP
80 .B EEXIST
81 .\"O Unable to generate a unique filename.
82 ¥æ¥Ë¡¼¥¯¤Ê¥Õ¥¡¥¤¥ë̾¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¡£
83 .TP
84 .B EINTR
85 .\"O The call was interrupted by a signal.
86 ¸Æ¤Ó½Ð¤·¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤ÆÃæÃǤµ¤ì¤¿¡£
87 .TP
88 .B EMFILE
89 .\"O Too many file descriptors in use by the process.
90 1 ¤Ä¤Î¥×¥í¥»¥¹¤Ç»ÈÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¿ô¤òĶ²á¤·¤¿¡£
91 .TP
92 .B ENFILE
93 .\"O Too many files open in the system.
94 ¥·¥¹¥Æ¥àÁ´ÂΤǥª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤òĶ²á¤·¤¿¡£
95 .TP
96 .B ENOSPC
97 ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤òÄɲ乤뤿¤á¤Î¶õ¤­Îΰ褬¤Ê¤¤¡£
98 .TP
99 .B EROFS
100 .\"O Read-only file system.
101 ÆɤߤÀ¤·ÀìÍÑ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¢¤ë¡£
102 .\"O .SH "CONFORMING TO"
103 .SH ½àµò
104 SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001.
105 .\"O .SH NOTES
106 .SH Ãí°Õ
107 .\"O POSIX.1-2001 specifies:
108 .\"O an error message may be written to \fIstdout\fP if the stream
109 .\"O cannot be opened.
110 POSIX.1-2001 ¤Ç¤Ï¡¢
111 ¥¹¥È¥ê¡¼¥à¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
112 \fIstdout\fP ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½ñ¤­½Ð¤µ¤ì¤ë¡¢¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
113 .LP
114 .\"O The standard does not specify the directory that
115 .\"O .BR tmpfile ()
116 .\"O will use.
117 .\"O Glibc will try the path prefix \fIP_tmpdir\fP defined
118 .\"O in \fI<stdio.h>\fP, and if that fails the directory \fI/tmp\fP.
119 µ¬³Ê¤Ç¤Ï
120 .BR tmpfile ()
121 ¤¬»È¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
122 glibc ¤Ç¤Ï \fI<stdio.h>\fP ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë
123 \fIP_tmpdir\fP ¤ò¥Ñ¥¹¤ÎÀèƬ¤Ë»È¤ª¤¦¤È¤¹¤ë¡£
124 ¤³¤ì¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê \fI/tmp\fP ¤ò»È¤¦¡£
125 .\"O .SH "SEE ALSO"
126 .SH ´ØÏ¢¹àÌÜ
127 .BR exit (3),
128 .BR mkstemp (3),
129 .BR mktemp (3),
130 .BR tempnam (3),
131 .BR tmpnam (3)