Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ msync(3C) — svr4 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

memcntl(2)

mmap(2)

sysconf(3C)



MSYNC(3C-SVR4)      RISC/os Reference Manual       MSYNC(3C-SVR4)



NAME
     msync - synchronize memory with physical storage

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

     int msync(caddrt addr, sizet len, int flags);

DESCRIPTION
     The function msync writes all modified copies of pages over
     the range [addr, addr + len) to their backing storage loca-
     tions.  msync optionally invalidates any copies so that
     further references to the pages will be obtained by the sys-
     tem 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.

     The effect of msync(addr, len, flags) is equivalent to:

          memcntl(addr, len, MC_SYNC, flags, 0, 0)

SEE ALSO
     memcntl(2), mmap(2), sysconf(3C).

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

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







                        Printed 11/19/92                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026