File: mremap.2

package info (click to toggle)
manpages-ja 0.5.0.0.20050315-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,620 kB
  • ctags: 4
  • sloc: sh: 12,675; perl: 157; makefile: 106
file content (144 lines) | stat: -rw-r--r-- 5,329 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
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1996 Tom Bjorkholm <tomb@mydata.se>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" 1996-04-11 Tom Bjorkholm <tomb@mydata.se>
.\"            First version written (1.3.86)
.\" 1996-04-12 Tom Bjorkholm <tomb@mydata.se>
.\"            Update for Linux 1.3.87 and later
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\"         all rights reserved.
.\" Translated Sun Feb 23 16:44:36 JST 1997
.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated Tue Nov 26 JST 2002 by Kentaro Shirakata <argrath@ub32.org>
.\"
.\"WORD:	virtual memory		ۥ
.\"WORD:	remap			ƥޥåԥ
.\"WORD:	argument		
.\"WORD:	address space		ɥ쥹
.\"WORD:	page align		ڡ
.\"WORD:	linear			˥
.\"WORD:	process			ץ
.\"WORD:	segment			
.\"WORD:	real memory		¥
.\"WORD:	segmentation violation	ơ󿯳
.\"WORD:	segmentation fault	ơȿ
.\"WORD:	scheme			
.\"WORD:	implement		
.\"WORD:	lock			å
.\"
.TH MREMAP 2 1996-04-12 "Linux 1.3.87" "Linux Programmer's Manual"
.SH ̾
mremap \- ۥꡦɥ쥹ƥޥåԥ󥰤
.SH 
.B #include <unistd.h>
.br
.B #include <sys/mman.h>
.sp
.BI "void * mremap(void *" old_address ", size_t " old_size
.BI ", size_t " new_size ", unsigned long " flags );
.fi
.SH 
\fBmremap\fR ¸ߤꡦޥåפĥ(ޤϽ̾)롣
Ʊˤϰư뤫⤷ʤ(\fIflags\fR 
Ѳǽʲ(virtual)ɥ쥹֤ˤäƷޤ)

\fIold_address\fR ϳĥ(ޤϽ̾)褦Ȥ벾ۥꡦ֥å
θΥɥ쥹\fIold_address\fR ϥڡ(align)˹äƤʤ
ʤʤȤդ뤳ȡ\fIold_size\fR ϸβۥꡦ֥å
\fInew_size\fR ׵᤹ѹβۥꡦ֥åΥ

\fIflags\fR ϥե饰ΥӥåȥޥåפǤ롣

Linux Ǥϥϥڡʬ䤵롣桼ץ(Ĥޤ)
ʣΥ˥(linear)ʲۥꡦ(segment)ġ
줾βۥꡦȤϰĤޤϤʾμ(real)ꡦڡ
˥ޥåԥ󥰤Ƥ(ޥåԥ󥰾ϥڡơ֥Ǵ)
ۥꡦȤˤϥݸ()ꤵƤꡢ
꤬˥줿(㤨ɤ߹ѤΥȤ
񤭹)ơ󿯳(segmentation violation)
ޤȳβۥ˥ˤ
ơ󿯳ȯ롣

\fBmremap\fR  Linux Υڡơ֥Ѥ롣\fBmremap\fR 
ۥɥ쥹ȥꡦڡΥޥåԥ󥰤ѹ롣˸ΨŪ
\fBrealloc\fR Τ˻ѤƤ롣

.SH ե饰
.TP
.B MREMAP_MAYMOVE
ߤβۥɥ쥹ǥѹǤʤԤ
ۥɥ쥹ѹ뤳Ȥؼ롣

.SH ֤
 \fBmremap\fR ϿۥΰؤΥݥ󥿡֤
顼ξ
.B MAP_FAILED
(Ĥޤ (void *) \-1) ֤졢\fIerrno\fR Ŭڤꤵ롣

.SH 顼
.TP
.B EAGAIN
ꡦȤå(lock)Ƥꡢƥޥåԥ󥰤Ǥʤ
.TP
.B EFAULT
֥ơȿ(segmentation fault)
\fIold_address\fP  \fIold_address\fP+\fIold_size\fP 
ϰϤΥɥ쥹Τɤ줫Υץˤʲۥꡦɥ쥹Ǥ롣
Ȥ׵ᤷɥ쥹Τޤ褦ʥޥåԥ󥰤äȤƤ⡢
Υޥåԥ󥰤ۤʤäʤ EFAULT 
.TP
.B EINVAL
ʰͿ줿Ƥ \fIold_address\fR ڡ
äƤʤ
.TP
.B ENOMEM
ߤβۥɥ쥹Ǥϥΰ褬ĥǤ
.B MREMAP_MAYMOVE
ե饰 \fIflags\fR ꤵƤʤ
ޤϽʬ()꤬¸ߤʤ
.SH 
ߤΥС glibc Υ󥯥롼ɥեǤϡ
.B MREMAP_MAYMOVE
뤿ˤϡ<sys/mman.h> 򥤥󥯥롼ɤ
_GNU_SOURCE ɬפ롣
.SH 
Υ Linux ͭǤꡢܿտޤץǻѤƤ
ʤ4.2BSD ˤ (ºݤ˼Ƥ櫓ǤϤʤ)
ۤä(semantics)ˤ
.BR mremap (2)
뤬ä
.SH Ϣ
.BR brk (2),
.BR getpagesize (2),
.BR mmap (2),
.BR sbrk (2),
.BR realloc (3),
.BR malloc (3)
.P
ڡʬ䤵줿ˤĤƤäȾܤΤꤿʤ
ʤιߤ OS ζʽ򻲾Ȥ뤳ȡ
(\fIModern Operating Systems\fR by Andrew S. Tannenbaum, 
\fIInside Linux\fR by Randolf Bentson,
\fIThe Design of the UNIX Operating System\fR by Maurice J. Bach.)