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
|
.\" 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>
.\"
.\"WORD: virtual memory ۥ
.\"WORD: remap ƥޥå
.\"WORD: argument
.\"WORD: address space ɥ쥹
.\"WORD: page aligne ڡ
.\"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 ϥڡ(aligne)˹äƤʤ
ʤʤȤդ뤳ȡ\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 ϿۥΰؤΥݥ֤
顼ξ \-1 ֤졢\fIerrno\fR Ŭڤꤵ롣
.SH 顼
.TP
.B EINVAL
ʰͿ줿Ƥ \fIold_address\fR ڡ
äƤʤ
.TP
.B EFAULT
֥ơȿ(segmentation fault)ס
\fIold_address\fR \fIold_address\fR+\fIold_size\fR
ϰϤΥɥ쥹Τɤ줫Υץˤʲۥ
ꡦɥ쥹Ǥ롣㤨ᤷɥ쥹ΤΥޥåפ
¸ߤȤƤ⡢Υޥåפۤäʤ EFAULT
.TP
.B EAGAIN
ꡦȤå(lock)ƤꡢƥޥåפǤʤ
.TP
.B ENOMEM
ߤβۥɥ쥹Ǥϥΰ褬ĥǤ\fIMREMAP_MAYMOVE\fR
ե饰 \fIflags\fR ꤵƤʤޤϽʬ()꤬
¸ߤʤ
.SH
Υ Linux ͭǤꡢܿտޤץǻѤƤ
ʤ4.2BSD (ºݤ˼Ƥ櫓ǤϤʤ)
ۤä(semantics)ˤ
.BR mremap (2)
äƤ롣
.SH Ϣ
.BR getpagesize (2),
.BR realloc (3),
.BR malloc (3),
.BR brk (2),
.BR sbrk (2),
.BR mmap (2)
.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.)
|