.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.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. .\" Translated into Spanish Tue Jan 13 1998 by Gerardo Aburruzaga .\" García .\" .TH MSYNC 2 "12 Abril 1996" "Linux 2.0.32" "Manual del Programador de Linux" .SH NOMBRE msync \- sincroniza un fichero con un mapa de memoria .SH SINOPSIS .B #include .br .B #include .sp .B #ifdef _POSIX_MAPPED_FILES .br .B #ifdef _POSIX_SYNCHRONIZED_IO .sp .BI "int msync(void *" comienzo ", size_t " longitud ", int " flags ); .sp .B #endif .br .B #endif .SH DESCRIPCIÓN .B msync vuelca a disco los cambios hechos en la copia en memoria de un fichero que ha sido mapeado en memoria empleando \fBmmap\fP (2). Sin la utilización de esta llamada no está garantizado que los cambios se escriban de vuelta antes de que se llame a \fBmunmap\fP (2). Para ser más precisos, se actualiza la parte del fichero que corresponde al área de memoria que empieza en .I comienzo y tiene de tamaño \fIlongitud\fP. El argumento .I flags puede tener a 1 los bits MS_ASYNC, MS_SYNC y MS_INVALIDATE, pero no a la vez MS_ASYNC y MS_SYNC. MS_ASYNC planifica una actualización para más adelante, pero la llamada regresa inmediatamente. MS_SYNC pide una actualización y espera que se complete. MS_INVALIDATE pide invalidar cualesquiera otros mapeos del mismo fichero (de forma que puedan actualizarse con los valores frescos recién escritos). .SH "VALOR DEVUELTO" En caso de éxito se devuelve 0. En caso de error se devuelve \-1 y se pone un valor apropiado en \fIerrno\fP. .SH ERRORES .TP .BR EINVAL .I comienzo no es múltiplo de PAGESIZE, o cualquier bit distinto de MS_ASYNC | MS_INVALIDATE | MS_SYNC está a 1 en .IR flags. .TP .B EFAULT La memoria indicada (o parte de ella) no ha sido mapeada. .SH "CONFORME A" POSIX.1b (anteriormente POSIX.4) .SH "VÉASE TAMBIÉN" .BR mmap (2), B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 y 389-391.