*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/msync (2)              
Title
Content
Arch
Section
 

Contents


msync(2)							      msync(2)


NAME    [Toc]    [Back]

     msync - synchronize memory	with physical storage

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/mman.h>

     int msync(void *addr, size_t len, int flags);

DESCRIPTION    [Toc]    [Back]

     The function msync	writes all modified copies of pages over the range
     [addr, addr + len)	to their backing storage locations.  msync optionally
     invalidates any copies so that further references to the pages will be
     obtained by the system from their backing storage locations.  The backing
     storage for a modified MAP_SHARED mapping is the file the page is mapped
     to; the backing storage for a modified MAP_PRIVATE	mapping	is its swap
     area.

     flags is a	bit pattern built from the following values:

	  MS_ASYNC		   perform asynchronous	writes
	  MS_SYNC		   perform synchronous writes
	  MS_INVALIDATE		   invalidate mappings

     If	MS_ASYNC is set, msync returns immediately once	all write operations
     are scheduled; if MS_SYNC is set, msync does not return until all write
     operations	are completed.

     MS_INVALIDATE invalidates all cached copies of data in memory, so that
     further references	to the pages will be obtained by the system from their
     backing storage locations.

     msync will	fail if:

     [EINVAL]	    If addr is not a multiple of the page size as returned by
		    sysconf(3C).

     [EIO]	    An I/O error occurred while	reading	from or	writing	to the
		    file system.

     [ENOMEM]	    Addresses in the range (addr, addr + len) are outside the
		    valid range	for the	address	space of a process or pages
		    not	mapped are specified.

     [EBUSY]	    MS_INVALIDATE was specified	and one	or more	of the pages
		    was	locked in memory.

SEE ALSO    [Toc]    [Back]

      
      
     mmap(2), mpin(2), sysconf(3C).






									Page 1






msync(2)							      msync(2)


DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, the function msync returns 0; otherwise, it
     returns -1	and sets errno to indicate the error.

NOTES    [Toc]    [Back]

     msync should be used by programs that require a memory object to be in a
     known state, for example, in building transaction facilities.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
msync HP-UX synchronize the memory of a mapped file with physical storage
fsync IRIX synchronize a file's in-memory state with that on the physical medium
aio_fsync IRIX asynchronously synchronize a file's in-memory state with that on the physical medium
volunmigrate Tru64 Moves AdvFS domain storage from physical storage to LSM volumes (volmigrate) or from LSM volumes to ...
volmigrate Tru64 Moves AdvFS domain storage from physical storage to LSM volumes (volmigrate) or from LSM volumes to ...
msync Linux synchronize a file with a memory map
pvmove HP-UX move allocated physical extents from one LVM physical volume to other physical volumes
mem Tru64 physical memory interface
pmap_copy_page FreeBSD copy physical memory pages
pmap_copy FreeBSD copy physical memory pages
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service