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

  man pages->Tru64 Unix man pages -> mvalid (2)              



NAME    [Toc]    [Back]

       mvalid - Check memory region for validity

SYNOPSIS    [Toc]    [Back]

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

       int mvalid(
               caddr_t addr,
               size_t len,
               int prot );

PARAMETERS    [Toc]    [Back]

       Specifies  the  address of the region whose validity is to
       be checked.  Specifies length in bytes of the region specified
 by the addr parameter.  Specifies the desired access
       protection for the region.

DESCRIPTION    [Toc]    [Back]

       The mvalid() function checks  the  validity  of  a  memory
       region.  A region is considered to be valid if accesses of
       the requested type are allowed to  all  addresses  in  the

       The  <sys/mman.h> header file defines the following access
       options: The mapped region can be read.  The mapped region
       can be written.  The mapped region can be executed.

       The  prot  parameter  can be any combination of PROT_READ,
       PROT_WRITE, and PROT_EXEC ORed together.

RETURN VALUES    [Toc]    [Back]

       The mvalid() function returns 0 (zero) if accesses requiring
  the specified protection are allowed to all addresses
       within the specified range of  addresses.  Otherwise,  the
       mvalid()  function  returns  -1 and sets errno to indicate
       the error.

ERRORS    [Toc]    [Back]

       If the mvalid() function fails, errno may be set to one of
       the following values: The range specified by [addr, addr +
       len) is invalid for the process'  address  space,  or  the
       range specifies one or more unmapped pages, or one or more
       pages of the range disallows  accesses  of  the  specified
       protection.   The  prot  parameter is invalid, or the addr
       parameter is not a multiple of the page size  as  returned
       by sysconf(_SC_PAGE_SIZE).

SEE ALSO    [Toc]    [Back]

       Functions: mmap(2), mprotect(2), sysconf(3)

[ Back ]
 Similar pages
Name OS Title
DTtcvalid IRIX check a dat timecode for validity
testprns.1 IRIX check printer name for validity with smbd
chkprintcap FreeBSD check validity of entries in the print spooler database
shmat Tru64 Attach a shared memory region
shmid_ds Tru64 Defines a shared memory region
shmdt Tru64 Detach a shared memory region
mlock Tru64 Locks or unlocks a specified region in memory (P1003.1b)
munlock Tru64 Locks or unlocks a specified region in memory (P1003.1b)
mprotect Linux control allowable accesses to a region of memory
vm_map_protect FreeBSD apply protection bits to a virtual memory region
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service