File: mincore.2

package info (click to toggle)
manpages-es 1.55-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,472 kB
  • ctags: 6
  • sloc: sh: 1,349; makefile: 63
file content (119 lines) | stat: -rw-r--r-- 3,790 bytes parent folder | download | duplicates (4)
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
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (C) 2001 Bert Hubert <ahu@ds9a.nl>
.\"
.\" 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.
.\"
.\" Created Sun Jun 3 17:23:32 2001 by bert hubert <ahu@ds9a.nl>
.\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04.
.\"
.\" Traducido por Miguel Pérez Ibars <mpi79470@alu.um.es> el 5-julio-2004
.\"
.TH MINCORE 2 "3 junio 2001" "Linux 2.4.5" "Manual del Programador de Linux"
.SH NOMBRE
mincore \- obtiene información de qué páginas están en memoria
.SH SINOPSIS
.B #include <unistd.h>
.br
.B #include <sys/mman.h>
.sp
.BI "int mincore(void *" start ", size_t " length ", unsigned char *" vec );
.SH DESCRIPCIÓN
La función
.B mincore
solicita un vector describiendo qué páginas de un fichero están en memoria
y pueden ser leídas sin acceder a disco. El núcleo suministrará los datos
para los
.I length
bytes siguientes a la dirección
.I start.
Cuando regrese, el núcleo habrá rellenado
.I vec
con bytes, de los cuales el bit menos significativo indica si una página está 
residente en memoria.

Para que
.B mincore
tenga éxito,
.I start
debe estar situada en un límite de página. Es responsabilidad del
invocador redondear este valor a la página más cercana. El parámetro
.I length
no necesita ser un múltiplo del tamaño de página. El vector
.I vec
debe ser lo suficientemente grande para contener length/PAGE_SIZE bytes.
El tamaño de página puede obtenerse con
.BR getpagesize(2).

.SH "VALOR DEVUELTO"
En caso de éxito,
.B mincore
devuelve cero.
En caso de error, se devuelve \-1, y
.I errno
es modificado con el valor apropiado.
.SH ERRORES
.B EAGAIN
el núcleo se ha quedado temporalmente sin recursos
.TP
.B EINVAL
.I start
no es múltiplo del tamaño de página, o
.I len
tiene un valor no positivo
.TP
.B EFAULT
.I vec
apunta a una dirección inválida
.TP
.B ENOMEM
.I address
a
.I address
+
.I length
contiene memoria sin ubicar, o la memoria no es parte de un fichero.

.SH FALLOS
.B mincore
debería devolver un vector de bits y no un vector de bytes, A partir de la versión
2.4.5 de Linux, no es posible obtener información sobre la residencia en memoria 
de páginas no respaldadas por un fichero.
En otras palabras, una llamada a
.B mincore
sobre una región anónima devuelta por
.B mmap(2)
no funciona y asigna a errno el valor ENOMEM. A menos que las páginas estén bloqueadas
en memoria,
el contenido de
.I vec
puede estar desfasado para cuando alcancen el espacio de usuario.

.SH "CONFORME A"
.B mincore
no parece ser parte de POSIX o de la Single Unix Specification. 
.SH HISTORIA
La función mincore() apareció por primera vez en 4.4BSD.
.SH DISPONIBILIDAD
Presente desde Linux 2.3.99pre1 y glibc 2.2.
.SH "VÉASE TAMBIÉN"
.BR getpagesize (2),
.BR mmap (2)