Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mincore(2) — DG/UX R4.11MU05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getpagesize(2)

memcntl(2)

sysconf(2)



mincore(2)                     DG/UX R4.11MU05                    mincore(2)


NAME
       mincore - determine residency of memory pages

SYNOPSIS
       #include <unistd.h>

       int mincore(caddrt addr, sizet len, char *vec);

   where:
       addr  Starting address of the memory region to query

       len   Length in bytes of the memory region to query

       vec   Pointer to the byte array used to report page status

DESCRIPTION
       The mincore() function returns the primary memory residency status of
       pages in the address space covered by mappings in the range [addr,
       addr + len).  The addr parameter must be a page aligned address.  The
       len parameter is not required to be a multiple of the system page
       size.  However, len is rounded up to the next page size multiple
       before computing the ending address of the range to check.  Note that
       the system page size can be obtained by calling either getpagesize(2)
       or sysconf(2) with the SCPAGESIZE parameter; both calls return
       identical values.

       The status is returned as a byte-per-page in the byte array
       referenced by vec.  The byte array must therefore contain one byte
       for each page in the queried memory region.  The least significant
       bit of each byte is set to 1 to indicate that the referenced page is
       in primary memory, or to 0 if it is not.  The contents of the other
       bits in each byte are unspecified and reserved for future use;
       programs should not depend on their values.

       The mincore() function returns residency information that is accurate
       at a different instant in time for each page.  Because the system may
       frequently adjust the set of pages in memory, this information may
       quickly be outdated, and not necessarily even self-consistent.  Only
       locked pages are guaranteed to remain in memory (see memcntl(2)).

       Pages which are direct mapped to a memory-mapped device will be
       reported by mincore() to be memory resident.

ACCESS CONTROL
       No access check is made.

RETURN VALUE
       Upon successful completion, mincore() returns a value of 0.
       Otherwise, it returns the value -1, and sets errno to indicate the
       error.

DIAGNOSTICS
       Under the following conditions, mincore() fails and sets errno to:

       EINVAL         if the addr parameter is not a page aligned address.

       ENOMEM         if the len parameter is 0.

       ENOMEM         if some portion of the memory region to query is not
                      mapped in the caller's address space.

       EFAULT         if some portion of the byte array pointed to by vec is
                      not mapped in the caller's address space or lacks
                      write access.

SEE ALSO
       dgpaginginfo(2), getpagesize(2), memcntl(2), sysconf(2).


Licensed material--property of copyright holder(s)

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