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
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (C) 2001 David Gez <davidge@jazzfree.com>
.\"
.\" 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.
.\"
.\" Based on comments from mm/filemap.c. Last modified on 10-06-2001
.\" Modified, 25 Feb 2002, Michael Kerrisk, <mtk-manpages@gmx.net>
.\" Added notes on MADV_DONTNEED
.\"
.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
.\" Translated Thu Aug 16 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated Tue 8 Oct 2002 by NAKANO Takeo
.\"
.TH MADVISE 2 2001-06-10 "Linux 2.4.5" "Linux Programmer's Manual"
.SH ̾
madvise \- Ѥ˴ؤ륢ɥХͿ
.SH
.br
.B #include <sys/mman.h>
.sp
.BI "int madvise(void *" start ", size_t " length ", int " advice );
.SH
.B madvise
ƥॳϡɥ쥹
.I start
Ϥޤ
.I length
ХȤΥ֥åΥڡϤɤɤ
ͥ˥ɥХ롣
Ѥȡ
ץꥱ饫ͥˡ
ޥåפ줿䶦ͭɤΤ褦˰äƤۤ뤳ȤǤ
ͥϤ˱ɤߤ䥭åʤɤŬڤʼˡǤ롣
ΥϥץꥱưΤΤˤϱƶʤ
.RB ( MADV_DONTNEED
ξ)
ǽˤϱƶ롣
ʤΥɥХ뤫ɤϥͥǤ롣
.LP
ɥХϥѥ
.I advice
ˤäͿ롣ʲΤ줫Ǥ롣
.TP
.B MADV_NORMAL
̤ʰϹԤʤ줬ǥեȤǤ롣
.TP
.B MADV_RANDOM
ڡȤϥʽǹԤ줽
(äơɤߤϤޤ̤ʤ)
.TP
.B MADV_SEQUENTIAL
ڡȤϥʽǹԤ줽
(äͿϰϤΥڡѶŪɤߤƤɤ
ޤä®䤫˲ɤ)
.TP
.B MADV_WILLNEED
ᤤ˥줽
(äƤΥڡΤɤߤƤȤ)
.TP
.B MADV_DONTNEED
Ф餯Ϥʤ
(ǥץꥱͿϰϤνƤ롣
äƥͥϤ˴Ϣɤ)
ʹߤϰϤΥڡؤΥȡ
Ϥ뤬ƤޥåΥե뤫ɤľȤˤʤ
.RB ( mmap
)
ޤϸե뤬ʤޥåץڡǤ
äȤ 0 Ԥ뤳Ȥˤʤ롣
.SH ֤
.B madvise
0 ֤
顼 \-1 ֤
.I errno
Ŭڤͤꤹ롣
.SH 顼
.TP
.B EAGAIN
餫ΥͥŪѤǤʤä
.TP
.B EBADF
ꤷޥåפ¸ߤ뤬եǤϤʤȤޥåפƤ롣
.TP
.B EINVAL
.\" .I len
.\" is zero,
.I len
ͤ顢
.I start
ڡǤʤ
.I advice
ͤǤʤ
ץꥱå줿ڡ䶦ͭڡ
(MADV_DONTNEED ) 褦ȤƤ롢ʤɡ
.TP
.B EIO
(MADV_WILLNEED ξ) ϰϤΥڡԤȡ
ץ RSS (resident set size) κͤۤƤޤ
.\"nakano RSS 줬ޤä?
.TP
.B ENOMEM
(MADV_WILLNEED ξ) ꤬ꤺڡ˼Ԥ
.TP
.B ENOMEM
ꤷϰϤΥɥ쥹ߥޥåפƤʤ
뤤ϥץΥɥ쥹֤ˤʤ
.SH "LINUX ˤ"
ߤ Linux μ (2.4.0) Ǥϡ
ΥƥॳɥХȤ̿ȸƤ롣
äƤΥɥХФ̾ԤưԲǽʾϡ
顼֤Ȥ (嵭 顼 εҤ)
οɸȤϰۤʤ롣
.LP
Linux μǤ
.I start
Υɥ쥹ϥڡͤǤʤФʤʤޤ
.I length
0 ǤäƤʤ
ޤ Linux Ǥ
.B madvise
Ǥϡꤵ줿ɥ쥹ϰϤ˥ޥåפƤʤʬȡ
̵뤷ƻĤʬ˥ɥХŬѤ
(ƥॳФƤϤ
.B ENOMEM
֤)
.SH
.B madvise
ؿ 4.4BSD Ǻǽо줷
.SH
POSIX.1b (POSIX.4).
POSIX 1003.1-2001 Ǥϡ
.B posix_madvise
POSIX_MADV_NORMAL ʤɤȤȤ˵ҤƤ
(줾οϤǽҤ٤Τ˶ᤤ)
ե륢ФƤ
.I posix_fadvise
Ȥδؿ¸ߤ롣
.SH Ϣ
.BR getrlimit (2),
.BR mincore (2),
.BR mmap (2),
.BR mprotect (2),
.BR msync (2),
.BR munmap (2)
|