.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 2001 Bert Hubert .\" .\" 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 .\" Slightly adapted, following comments by Hugh Dickins, aeb, 2001-06-04. .\" .\" Traducido por Miguel Pérez Ibars 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 .br .B #include .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)