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
|
.\" 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
.\" Garca <gerardo.aburruzaga@uca.es>
.\"
.TH MSYNC 2 "Martes y 13 de Enero de 1998" "Linux 2.0.32" "Manual del Programador Linux"
.SH NOMBRE
msync \- sincroniza un fichero con un mapa de memoria
.SH SINOPSIS
.B #include <unistd.h>
.br
.B #include <sys/mman.h>
.sp
.B #ifdef _POSIX_MAPPED_FILES
.br
.B #ifdef _POSIX_SYNCHRONIZED_IO
.sp
.BI "int msync(const void *" comienzo ", size_t " longitud ", int " flags );
.sp
.B #endif
.br
.B #endif
.SH DESCRIPCIN
.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 utilizacin de esta llamada no est garantizado que los cambios
se escriban de vuelta antes de que se llame a \fBmunmap\fP (2).
Para ser ms precisos, se actualiza la parte del fichero que
corresponde al rea de memoria que empieza en
.I comienzo
y tiene de tamao \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 actualizacin para ms
adelante, pero la llamada regresa inmediatamente.
MS_SYNC pide una actualizacin y espera que se complete.
MS_INVALIDATE pide invalidar cualesquiera otros mapeos del mismo
fichero (de forma que puedan actualizarse con los valores frescos
recin 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 mltiplo 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 CON"
POSIX.1b (anteriormente POSIX.4)
.SH "VASE TAMBIN"
.BR mmap (2),
B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 y 389-391.
|