File: posix_memalign.3

package info (click to toggle)
manpages-ja 0.4.0.0.20020315-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 14,808 kB
  • ctags: 4
  • sloc: sh: 9,595; perl: 157; makefile: 62
file content (175 lines) | stat: -rw-r--r-- 4,482 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.\" (c) 2001 by John Levon <moz@compsoc.man.ac.uk>
.\" Based in part on GNU libc documentation.
.\"
.\" 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.
.\"
.\"WORD:	obsolete	ѻߤ줿
.\"WORD:	a multiple of	ܿ
.\"WORD:	a power of two	2 Τ٤
.\"
.\" 2001-10-11, aeb, added some details
.TH POSIX_MEMALIGN 3  2001-10-11 "GNU" "Linux Programmer's Manual"
.SH ̾
posix_memalign, memalign, valloc \- 饤Ȥ줿γƤԤ
.SH 
.nf
.B #include <stdlib.h>
.sp
.BI "int posix_memalign(void **" memptr ", size_t " alignment ", size_t " size );
.BI "void *memalign(size_t " boundary ", size_t " size );
.BI "void *valloc(size_t " size );
.nl
.fi
.SH 
ؿ
.B posix_memalign()

.I size
ХȤΥơƤ줿Υɥ쥹
.IR "*memptr"
ꤹ롣
Ƥ줿Υɥ쥹
.IR "alignment"
ܿˤʤäƤϤǤ롣
.IR "alignment"
 2 Τ٤ǡ
.IR "sizeof(void *)"
ܿǤʤФʤʤ

ѻߤ줿ؿǤ
.B memalign()
ϡ
.I size
ХȤΥơƤ줿ؤΥݥ󥿤֤
Υɥ쥹
.IR "boundary"
ܿˤʤäƤϤǤ롣
.IR "boundary"
 2 Τ٤ǤʤФʤʤ

ѻߤ줿ؿǤ
.B valloc()

.I size
ХȤΥơƤ줿ؤΥݥ󥿤֤
Υɥ쥹ϥڡܿˤʤäƤϤǤ롣

.IR "memalign(sysconf(_SC_PAGESIZE),size)"
Ǥ롣

.\" motoki: be not zeroed äƤɤ̣
3 ĤδؿϤΥꥢԤʤ

.SH ֤
.BR memalign()

.BR valloc()
ϳƤ줿ؤΥݥ󥿤֤
Ƥ˼Ԥ
.B NULL
֤

.BR posix_memalign()
 0 ֤
ԤϼΥ˵ܤ줿顼ͤΤ줫֤
.IR errno
ϥåȤʤȤդ뤳ȡ

.SH 顼
.TP
.B EINVAL
.IR alignment
ѥ᡼ 2 Τ٤Ǥʤä
.IR "sizeof(void *)"
ܿǤʤä
.TP
.B ENOMEM
׵Τ˽ʬʥ꤬ʤä

.SH 

.BR posix_memalign()

.IR alignment
Ǿܺ٤˽Ҥ٤ɬ׾ɤΤ롣
.BR memalign()

.IR boundary
ѥ᡼ɤγǧԤʤ⤷ʤ

POSIX Ǥ
.BR posix_memalign()
ˤäƳ
.IR free ()
ȤäƲ뤳ȤǤɬפ롣
ĤΥƥǤ
.IR memalign ()

.IR valloc ()
dzƤ줿Ѥʤ󶡤Ƥʤ
.\" motoki: while ΤĤʤϤǤ
(ʤʤ
.IR free ()
ϤȤǤΤ
.IR malloc ()
äݥ󥿤
.IR memalign ()

.IR malloc ()
ƤӽФͤ򥢥饤ȤƤޤǤ)
GNU libc Ǥ
˽Ҥ٤ 3 ĤδؿΤdz
.IR free ()
ǺѤ뤳ȤǤ롣

GNU libc 
.BR "malloc()"
Ͼ 8 ХȤ˥饤Ȥ줿ꥢɥ쥹֤Τǡ
ǽҤ٤ؿɬפˤʤΤ
8 ХȤ礭ʥ饤ȤɬפʾǤ롣

.SH 
.IR memalign ()

.IR valloc ()
Ϥ٤Ƥ Linux libc 饤֥ǻѲǽǤ롣
.IR posix_memalign ()
 glibc 2.1.91 ʹߤǻѲǽǤ롣

.SH 
ؿ
.IR valloc ()
 3.0 BSD о줷BSD 4.3 Ǥѻߤ줿ȵܤƤꡢ
SUSv2 ǤϲΤΤȵܤƤ롣
SUSv3 ǤϤϤϢ뵭ҤϤʤ
ؿ
.IR memalign ()
 SunOS 4.1.3 о줷BSD 4.4 ˤϤʤ
ؿ
.BR posix_memalign()
 POSIX 1003.1d ͳ褹롣
.SH Ϣ
.BR malloc (3),
.BR free (3),
.BR getpagesize(2),
.BR brk (2)