OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / cfree.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
24 .\"         all rights reserved.
25 .\" Translated Mon Jul 19 04:38:03 JST 2004
26 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
27 .\"
28 .TH CFREE 3 2007-07-26  "" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH Ì¾Á°
31 .\"O cfree \- free allocated memory
32 cfree \- ³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .nf
36 .sp
37 .B "#include <stdlib.h>"
38 .sp
39 .\"O /* In SunOS 4 */
40 /* SunOS 4 ¤Ç¤Ï */
41 .BI "int cfree(void *" ptr );
42 .sp
43 .\"O /* In glibc or FreeBSD libcompat */
44 /* glibc ¤È FreeBSD libcompat ¤Ç¤Ï */
45 .BI "void cfree(void *" ptr );
46 .sp
47 .\"O /* In SCO OpenServer */
48 /* SCO OpenServer ¤Ç¤Ï */
49 .BI "void cfree(char *" ptr ", unsigned " num ", unsigned " size );
50 .sp
51 .\"O /* In Solaris watchmalloc.so.1 */
52 /* Solaris watchmalloc.so.1 ¤Ç¤Ï */
53 .BI "void cfree(void *" ptr ", size_t " nelem ", size_t " elsize );
54 .fi
55 .sp
56 .in -4n
57 .\"O Feature Test Macro Requirements for glibc (see
58 .\"O .BR feature_test_macros (7)):
59 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
60 .RB ( feature_test_macros (7)
61 »²¾È):
62 .in
63 .sp
64 .BR cfree ():
65 _BSD_SOURCE || _SVID_SOURCE
66 .\"O .SH DESCRIPTION
67 .SH ÀâÌÀ
68 .\"O This function should never be used.
69 .\"O Use
70 .\"O .BR free (3)
71 .\"O instead.
72 ¤³¤Î´Ø¿ô¤Ï·è¤·¤Æ»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£
73 Âå¤ï¤ê¤Ë
74 .BR free (3)
75 ¤ò»È¤¦¤³¤È¡£
76 .\"O .SS "1-arg cfree"
77 .SS "°ú¤­¿ô¤¬ 1 ¤Ä¤Î cfree"
78 .\"O In glibc, the function
79 .\"O .BR cfree ()
80 .\"O is a synonym for
81 .\"O .BR free (3),
82 .\"O "added for compatibility with SunOS".
83 glibc ¤Ç¤Ï¡¢´Ø¿ô
84 .BR cfree ()
85 ¤Ï
86 .BR free (3)
87 ¤ÎÊÌ̾¤Ç¤¢¤ê¡¢¡ÖSunOS ¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÄɲ䵤줿¡×¡£
88 .LP
89 .\"O Other systems have other functions with this name.
90 ¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î̾Á°¤ÎÊ̤δؿô¤¬¤¢¤ë¡£
91 .\"O The declaration is sometimes in
92 .\"O .I <stdlib.h>
93 .\"O and sometimes in
94 .\"O .IR <malloc.h> .
95 ¤³¤ÎÀë¸À¤Ï
96 .I <stdlib.h>
97 ¤Ë¸ºß¤¹¤ë¾ì¹ç¤â¤¢¤ë¤·¡¢
98 .I <malloc.h>
99 ¤Ë¸ºß¤¹¤ë¾ì¹ç¤â¤¢¤ë¡£
100 .\"O .SS "3-arg cfree"
101 .SS "°ú¤­¿ô¤¬ 3 ¤Ä¤Î cfree"
102 .\"O Some SCO and Solaris versions have malloc libraries with a 3-argument
103 .\"O .BR cfree (),
104 .\"O apparently as an analog to
105 .\"O .BR calloc (3).
106 SCO ¤È Solaris ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
107 °ú¤­¿ô¤¬ 3 ¤Ä¤Î
108 .BR cfree ()
109 ¤¬´Þ¤Þ¤ì¤ë malloc ¥é¥¤¥Ö¥é¥ê¤¬¤¢¤ë¡£
110 ¤³¤ì¤ÏÌÀ¤é¤«¤Ë
111 .BR calloc (3)
112 ¤ËÎà»÷¤·¤Æ¤¤¤ë¡£
113 .LP
114 .\"O If you need it while porting something, add
115 ²¿¤«¤ò°Ü¿¢¤¹¤ë»þ¤Ë¤³¤Î´Ø¿ô¤¬É¬Íפʾì¹ç¡¢
116 .sp
117 .in +4n
118 #define cfree(p, n, s) free((p))
119 .in
120 .sp
121 .\"O to your file.
122 ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤뤳¤È¡£
123 .LP
124 .\"O A frequently asked question is "Can I use
125 .\"O .BR free (3)
126 .\"O to free memory allocated with
127 .\"O .BR calloc (3),
128 .\"O or do I need
129 .\"O .BR cfree ()?"
130 ¤è¤¯¿Ò¤Í¤é¤ì¤ë¼ÁÌä¤Ï
131 .RB ¡Ö calloc (3)
132 ¤Ç³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ë¤Î¤Ë
133 .BR free (3)
134 ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¤«¡¢
135 ¤½¤ì¤È¤â
136 .BR cfree ()
137 ¤ò»È¤¦É¬Íפ¬¤¢¤ë¤«¡×¤È¤¤¤¦¤â¤Î¤Ç¤¢¤ë¡£
138 Åú¤¨:
139 .BR free (3)
140 ¤ò»È¤¦¤³¤È¡£
141 .LP
142 .\"O An SCO manual writes: "The cfree routine is provided for compliance
143 .\"O to the iBCSe2 standard and simply calls free.
144 .\"O The num and size
145 .\"O arguments to cfree are not used."
146 SCO ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë:
147 ¡Öcfree ¥ë¡¼¥Á¥ó¤Ï iBCSe2 µ¬³Ê¤Ë½¾¤¦¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤ª¤ê¡¢
148 ñ¤Ë free ¤ò¸Æ¤ó¤Ç¤¤¤ë¤À¤±¤Ç¤¢¤ë¡£
149 cfree ¤Î num ¤È size °ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£¡×
150 .\"O .SH "RETURN VALUE"
151 .SH ÊÖ¤êÃÍ
152 .\"O The SunOS version of
153 .\"O .BR cfree ()
154 .\"O (which is a synonym for
155 .\"O .BR free (3))
156 .\"O returns 1 on success and 0 on failure.
157 SunOS ÈǤÎ
158 .BR cfree ()
159 .RB ( free (3)
160 ¤ÎÊÌ̾) ¤Ï¡¢À®¸ù¤·¤¿¾ì¹ç¤Ë 1 ¤òÊÖ¤·¡¢¼ºÇÔ¤·¤¿¾ì¹ç¤Ë 0 ¤òÊÖ¤¹¡£
161 .\"O In case of error,
162 .\"O .I errno
163 .\"O is set to
164 .\"O .BR EINVAL :
165 .\"O the value of
166 .\"O .I ptr
167 .\"O was not a pointer to a block previously allocated by
168 .\"O one of the routines in the
169 .\"O .BR malloc ()
170 .\"O family.
171 ¥¨¥é¡¼¤Î¾ì¹ç¡¢
172 .I errno
173 ¤¬
174 .B EINVAL
175 ¤ËÀßÄꤵ¤ì¤ë:
176 .I ptr
177 ¤ÎÃͤ¬
178 .BR malloc ()
179 ·Ï¤Î¥ë¡¼¥Á¥ó¤Î 1 ¤Ä¤Ç°ÊÁ°¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿
180 ¥Ö¥í¥Ã¥¯¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¡£
181 .\"O .SH "CONFORMING TO"
182 .SH ½àµò
183 .\"O The 3-argument version of
184 .\"O .BR cfree ()
185 .\"O as used by SCO conforms to the iBCSe2 standard:
186 .\"O Intel386 Binary Compatibility Specification, Edition 2.
187 SCO ¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ë°ú¤­¿ô¤¬ 3 ¤Ä¤Î
188 .BR cfree ()
189 ¤Ï¡¢iBCSe2 µ¬³Ê:
190 Intel386 Binary Compatibility Specification, Edition 2
191 (Intel386 ¥Ð¥¤¥Ê¥ê¸ß´¹»ÅÍÍ¡¢Âè 2 ÈÇ) ¤Ë½àµò¤¹¤ë¡£
192 .\"O .SH SEE ALSO
193 .SH ´ØÏ¢¹àÌÜ
194 .BR malloc (3)